• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts Validator

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 471
Mac OS X Hibernate Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic