wood burning stoves 2.0*
The moose likes Struts and the fly likes radiobutton and Validwhen problem! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "radiobutton and Validwhen problem!" Watch "radiobutton and Validwhen problem!" New topic
Author

radiobutton and Validwhen problem!

shah rah
Ranch Hand

Joined: Jan 04, 2007
Posts: 124


The validation fires for YES and NO radiobutton click. I want the required error to be displayed if "NO" radiobutton is clicked and the textarea is empty. Pls guide me
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Originally posted by shah rah:
I want the required error to be displayed if "NO" radiobutton is clicked and the textarea is empty.

In that case, the logic in the code you posted is faulty. When you specify a condition in a validwhen validation, you should be describing a scenario that is valid, not one that isn't valid. You therefore need to change your code to:

I also believe spaces are required around "or" so make that change as well.
[ February 28, 2007: Message edited by: Merrill Higginson ]

Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: radiobutton and Validwhen problem!
 
Similar Threads
validwhen returns required error messge
validate two passwords in struts
Validwhen
struts validation
Struts validation help needed....