Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts error, focus the error field

 
Nilesh Naik
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a struts jsp and ActionForm for that jsp. The form validation is done in the action form.If there are any errors, those are displayed on the jsp.
I want to get the focus on the first error field on the jsp.

Can anyone let me know how to do that?

Regards,
Nilesh.
 
Jan Groth
Ranch Hand
Posts: 456
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i dont know of any mechanism you could use...

guess you will need a scriptlet / js which parses the error map in the request / session and focuses the right field on the page if a appropriate error is found.

no rocket science, but you'll probably need a few hours to test and implement.

also note that "the first field" is something you can usually not decide automatically.

:-)

happy coding,
jan
[ January 19, 2007: Message edited by: Jan Groth ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic