This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Struts and the fly likes Struts Validation using Struts Framework Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts Validation using Struts Framework" Watch "Struts Validation using Struts Framework" New topic
Author

Struts Validation using Struts Framework

Vicky Mohan
Ranch Hand

Joined: Oct 14, 2004
Posts: 130
I just want to know if the following condition can be verified using STRUTS validation framework

I have a form with four fields. They are not REQUIRED, but as the User focusses on a field and navigates to the next field without entering any value, i want to generate an alert message saying he hasnt entered any values for the field he skipped. Its not a error, but just a warning message.

I can get this working with Plain Javascript, just wondering if the validator framework has any implementation for this

Thanks for all your suggestion.
alan do
Ranch Hand

Joined: Apr 14, 2005
Posts: 354
struts validation framework provides true/false answer to a validation question (and display an error message). if you want to use 'warnings', you have to pull lots of tricks. it's best done using plain javascript; otherwise, you need to do full validation and display an error message stating that the first field is required.


-/a<br />certified slacker...yes, my last name is 'do' - <a href="http://www.luckycouple.com" target="_blank" rel="nofollow">luckycouple.com</a>
 
Don't get me started about those stupid light bulbs.
 
subject: Struts Validation using Struts Framework