This is not a
JSP question but an HTML/Javascript one. JSPs offer no support for user-interaction, that is relient upon browser supported javascript (and keep in mind such features can be disabled on browsers).
Back to your question... you need to add javascript events on the form boxes (check out the 18.2.3 in
http://www.w3.org/TR/html4/interact/scripts.html for list of events). The best way is to create a javascript function in the header of your html page and call this function on a common even on this form such as onchange event.