• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

javascript setfocus

 
charu setia
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic