File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts Validation using Struts Framework" Watch "Struts Validation using Struts Framework" New topic

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="" target="_blank" rel="nofollow"></a>
I agree. Here's the link:
subject: Struts Validation using Struts Framework
jQuery in Action, 3rd edition