View Full Version : position to a field
jerry62704
07-15-2008, 06:24 PM
Within jsp, how do I position to a specific field. For example, on a verification of input error, I want to position the cursor to the failing field (and optionally turn the label red).
In javascript I would set the focus, but I don't know how to do that in java.
brad211987
07-15-2008, 10:36 PM
I think you will still need to use javascript. I don't know of a way to control the focus using JSP, as that is more of a client side issue. Maybe you could set a variable to hold the name/id of the input that is in error, and then pick that up in the javascript function to set the focus.
jerry62704
07-16-2008, 04:15 PM
Thanks, that what I expected. Too new to have known it for a fact, so I asked the question.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.