部分Web表单请求,AJAX

I'm not sure how to ask this.

I have a HTML form that has several fields, including user id, which maps to a real name. I have jQuery validation of the form working.

Right now, I have to submit the POST request, to show the user's real name.

example: It should show "john doe" if the user types "3", before without clicking submit.

ID input: [3] ( john doe )

Do I use jQuery to retrieve this information? Do I also set up a new page, that has a response to a POST request, that returns 'john doe' as XML / JSON or something along those lines?

note: Using python's Flask. Maybe I should use Flask-Sijax ?

The Flask documentation has a good example using jquery to fetch a value from the server without posting the whole page.

If you wanted it to fire as a user types the number (rather then hitting a button in the example) you could use the .keyup event in jQuery instead of the .bind/click event shown the example.