aspose file tools*
The moose likes Struts and the fly likes javascript setfocus Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "javascript setfocus" Watch "javascript setfocus" New topic
Author

javascript setfocus

charu setia
Greenhorn

Joined: Nov 01, 2007
Posts: 4
Hi all,
I have a problem with the javascript page.Its like i have around 76 fields in my Jsp.from Jsp i m calling my javascript page.there some validations are occuring for all the fields.if a user enters some wrong value, say for some 40th field, the error message will appear.when the user clicks "ok", the wrong value entered will be selected but the focus goes to the top og page.i want the focus to come on that particular field.
I am already using select() method for selecting the value.
I also tried with setfocus() and focus(), but of no use.
If anybody can can help me out, plase reply
Thankks in advance
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
One way to do this is to include JavaScript code similar to the following in a function that is executed from the body's onload event.

Unfortunately, if you have 40 different properties, you'll have to repeat this code 40 times.


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: javascript setfocus