Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to highlight error field in struts html form?

 
Abhishek Reddy
Ranch Hand
Posts: 259
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to highlight error fields in struts html form when validation fails?

Note: Validations are performed on the server side (validate() method of respective form bean)
 
Bilal A. Siddiqui
Ranch Hand
Posts: 53
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is it struts2 ??
 
Abhishek Reddy
Ranch Hand
Posts: 259
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no iam using struts 1.2.9
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're doing it right, and using Struts form tags, they'll be highlighted automatically, no?
 
Abhishek Reddy
Ranch Hand
Posts: 259
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for the reply........
sorry it is not happening........please let me know where i went wrong

this is what iam doing...



Note: where "name" and "id" refers to struts html field names?
do i need to make any addtional changes to make it happen?
 
Lei Guoguo
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can definited these key in your MessageResource.properties


in your html page you can used like this
 
amma mal
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what I did is use resources.properties file there you have to give key ,value error details
in struts-config.xml use <message-resource> to include property file
give corresponding error property in validation xml file
it definetley works
 
Abhishek Reddy
Ranch Hand
Posts: 259
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry guys.........i want my cursor focus on the error field when validation fails.

Please let me know, is it possible to retrieve the error field name on the client side when validation fails....



 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic