struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brandon Mercer <bran...@eutonian.com>
Subject Re: multi-page validation form
Date Tue, 22 Mar 2005 16:29:17 GMT
Jack Perrett wrote:

>Thanks for gettig back to me so quickly.
>I am actually setting the hidden page property. I'm using a StrutsTest so
>the jsp doesn't actually exist at the moment but I'm creating a form, and
>setting the fields, and then using
>
>    form.setPage(2);
>
>to set the this property. So I'm effectively submitting a form with the
>hidden page property set to 2.
>any ideas what else could be stopping it?
>
>----- Original Message ----- 
>From: "Brandon Mercer" <brandon@eutonian.com>
>To: "Struts Users Mailing List" <user@struts.apache.org>
>Sent: Tuesday, March 22, 2005 4:04 PM
>Subject: Re: multi-page validation form
>
>
>  
>
>>Jack Perrett wrote:
>>
>>    
>>
>>>I'm trying to create a form that will be validated over a series of
>>>      
>>>
>jsp's. I'm using the page property with individual fields to specify whether
>they should be validated on a particular page and then setting the hidden
>page property to whatever the corurrent jsp page.
>  
>
>>>This is how my field looks in the validation.xml
>>>
>>><field property="adults"
>>>                    page="2"
>>>                    depends="required">
>>>
>>>                 <arg0 key="passengerBookingForm.adults"/>
>>></field>
>>>
>>>But it just seems to ignore this validation whatever I set the form page
>>>      
>>>
>property to. I'm expecting it to perform this validation if the form page
>property is >= 2, and ignore the validation altogether if the form page
>property is < 2.
>  
>
It's not going to validate this page when it's GREATER than or = to 2...
only if it's value is two.  That's the first thing.  The second thing
is, that in your JSP you need to also have hidden fields for the form
fields you've collected on the previous pages.  Like this.
<html:hidden property="previousvalue"/>
<html:hidden property="previousvalue2"/>
<html:hidden property="previousvalue3"/>
:-)
Brandon

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message