| Author |
Struts Validator
|
Anoop Retnakumar
Greenhorn
Joined: Feb 09, 2008
Posts: 1
|
|
Hi, I have a struts application in which all the client side validations are done using Validator framework. For mandatory checks i will get a alert message in an alert box. Now I need to replace this message box and I need to display the message in the JSP page itself just beside of the mandatory fields. Please help me in this regard. Thank you Regards Anoop
|
 |
Alaa Nassef
Ranch Hand
Joined: Jan 28, 2008
Posts: 460
|
|
To get an alert box, you use the <html:javascript> tag to generate the validation javascript, and in your form you use the onsubmit attribute to call the validate method. To do what you want, you have to have the following 1- Remove the onsubmit attribute from the html form 2- Make sure that you have validate="true" in the struts-config's action you want to validate 3- Make sure that the input attribute of that action points to the JSP 4- Use <html:errors> to display the errors on the JSP page
|
Visit my blog: http://jnassef.blogspot.com/
|
 |
 |
|
|
subject: Struts Validator
|
|
|