It looks more like javascript problem, as you would like to handle it on the browser end only(for performance reason).
Are you interested in
JSP level solution? (although javascript will still be there)
Prakash Dwivedi (SCJP2, SCWCD, SCBCD)
"Failure is not when you fall down, Its only when you don't get up again"