There's 2 ways that I've been using:

1. after submitting the form, send to a page that does the validation
if valid:  redirect to the right page
if not: display what data was incorrect and have a link that says
"go back and correct the form"

2.
after submitting the form, send to a page that does the validation:
if valid:  redirect to the right page
if not:  return to the form with additional parameters.
For instance, if the first name and last name field was black,
The link redirection back to the form would be

http://yourhost/FormOne?blankfields="Firstname,Lastname"
The form would be displayed with some kind of marker next to it to immediately
point the user to the field that needs correction.

This gets a little complex, but it works great and it's very user friendly.



--
Antonio W. Lagnada
[EMAIL PROTECTED] - email

This email address is specifically
for JSP-Interest email list


---- Brian Slezak <[EMAIL PROTECTED]> wrote:
>     What is the appropriate way to validate a form using JSP?   A normal,
> validate the form input and explain which entries need to be changed
> if any
> form.  Should this be done within one JSP page, or should it be posted
> to a
> second JSP page?
>
> Thanks for all help.
> Brian
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>

___________________________________________________________________
To get your own FREE ZDNet Onebox - FREE voicemail, email, and fax,
all in one place - sign up today at http://www.zdnetonebox.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to