You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Witt, Mike (OH35)" <mi...@honeywell.com> on 2002/01/23 21:56:49 UTC

Question about forms and validation.

Hi,

I have a question about the validate method on the ActionForm.  From my
understanding, 
if a validation error is found, you set up a collection of ActionErrors and
return this.  This 
causes struts to forward back to your input form, correct?  

In my situation, I populate a form for editing.  When the submit is clicked,
I validate the entry.  
When a validation error occurs, it always displays the original form data.
Is there a way to 
get it to display the form as the user edited it?  Many times a large
quantity of good data is 
lost because of one bad field.  

Thanks for your help,

Mike Witt


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Question about forms and validation.

Posted by David Gaulin <dg...@videotron.ca>.
Mike,

If you have the proper ActionForm class which represent the proper field in
you form and you use the struts html custom tag, your data should come back.
That is one of the best feature of Struts.

Hope this helps

David

----- Original Message -----
From: "Witt, Mike (OH35)" <mi...@honeywell.com>
To: <st...@jakarta.apache.org>
Sent: Wednesday, January 23, 2002 2:56 PM
Subject: Question about forms and validation.


> Hi,
>
> I have a question about the validate method on the ActionForm.  From my
> understanding,
> if a validation error is found, you set up a collection of ActionErrors
and
> return this.  This
> causes struts to forward back to your input form, correct?
>
> In my situation, I populate a form for editing.  When the submit is
clicked,
> I validate the entry.
> When a validation error occurs, it always displays the original form data.
> Is there a way to
> get it to display the form as the user edited it?  Many times a large
> quantity of good data is
> lost because of one bad field.
>
> Thanks for your help,
>
> Mike Witt
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>