Struts Validator issue - Please Help

S

Saad Malik

Hi Everyone,

I'm building a wizard flow that has about 5 pages linked to the same
form. The only issue I'm having is the validator is requiring fields
that haven't even been submitted.. Example:

Assume the ActionForm contains two fields (both of them required):
firstName and SSN..

On the first page the user would enter his firstName and click next to
type in the SSN.

So in the validation.xml I would depend both of firstName and SSN, but
it never moves from the first page because SSN is always empty...

Please tell me the **BEST** solution... (j/k)... I want the cleanest
and 'best practiced' solution please...

Thanks.
 
S

Sudsy

Saad Malik wrote:
On the first page the user would enter his firstName and click next to
type in the SSN.

So in the validation.xml I would depend both of firstName and SSN, but
it never moves from the first page because SSN is always empty...

Please tell me the **BEST** solution... (j/k)... I want the cleanest
and 'best practiced' solution please...
<snip>

From the documentation to which you should have already referred (vis
<http://struts.apache.org/userGuide/dev_validator.html>), here's an
extract:

"Multi Page Forms

The field element has an optional page attribute. It can be set to an
integer. All validation for any field on a page less than or equal to
the current page is performed server side. All validation for any field
on a page equal to the current page is generated for the client side
Javascript. A mutli-part form expects the page attribute to be set.

<html:hidden property="page" value="1"/>
"

IOW, RTFM.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top