Hi,

I am writing a simple login validation pgm. I have a HTML file which has the

login form and it action points to a JSP page that needs to be displayed
ONLY AFTER the
user has been successfully validated.

Also, I have a JavaScript file that holds function to check for empty fields
in the form and
sends an alert.

Basically

1. If empty fields are present the JavaScript, alert needs to be called and
the HTML form page
should still be visible.

2. If userId and password are entered but are not valid, then the JSP page
that prints out the
error message has to be displayed.


Here is what happens. When the HTML form is called in the browser, and
userid or password is not entered
then the alert is displayed properly. After entering the userid and
password, it goes to the JSP
page properly.

BUT when, I use the browser's BACK button, and go to the HTML form page, and
if the password field is not
present and try to hit submit button, The Alert message is displayed AS WELL
AS the JSP page too, seems
like the SUBMIT action is getting called. How do I fix this, so that even if
teh user, hits the
BACK button and tries to login giving empty fields, ONLY the alert has to be
displayed.

Any pointers???
Thanks
PHR

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

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to