• 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

Validator..How to stop the validation after the first field?

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have two text fields in my form. I am using the validator for the form validation.
What happens is that when I submit the form, I get the validation message for both the fields like " Name is required field,Password is required field".
Please write me how can I stop the validation so that I can display one one message.
Thanks,
Umar
 
author & internet detective
Posts: 41919
910
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Umar,
You don't actually have to stop the validation. You just have to hide the messages. Instead of looping through the list of error messages, you can display the first one.
 
Umar Hathab Abdullah
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Jeanne,
But will you tell me how this is possible when doing the client side javascript validation.
I would also like to know how we can hide the messages both for server side and client side validations.
I am new to validator and I wud greatly appreciate the help.
Regards,
Umar
 
Author
Posts: 350
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Depends how good you are at JavaScript. (I am not the greatest at it, but get by).
You can customize the JavaScript that gets output to the browswer.
Look inside validator-rules.xml file in your WEB-INF directory.
 
reply
    Bookmark Topic Watch Topic
  • New Topic