This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Struts and the fly likes Validate if a field is present Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Validate if a field is present" Watch "Validate if a field is present" New topic
Author

Validate if a field is present

Gigi Kent
Ranch Hand

Joined: Nov 30, 2004
Posts: 40
Hello.
I'm using DynaValidatorForm and I'm using the validator. It works fine but I have a field who appears only if I click a button. I want to validate that field too but if is not present every time appears the validation for that field.
So I want to validate only if is present. There is something like this ?
Thanks.
Kerry Wilson
Ranch Hand

Joined: Oct 29, 2003
Posts: 254
How are you hiding the field? If you are just hiding it with styles it will still be submitted with the form.


http://www.goodercode.com
SCJP 1.4
Gigi Kent
Ranch Hand

Joined: Nov 30, 2004
Posts: 40
I don't hide the field. I have something like this:
<logic resent name="test">
<html:text property="field1">
</logic resent>
I hope is clear.
Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Validate if a field is present
 
Similar Threads
Regexp question
Conditional validation in Struts2
Handling data carry between different pages - Design handliing.
Validating text field only when the another text field is present
Validate field