Hi,
Try the following.
<script language='javascript'>
function verifydate()
{
if (document.form1.txtbox.value == "") then
{
document.form1.txtbox.focus();
return false;
}else
return true;
}
</script>
<html>
<body>
<form method='post' onSubmit='return verifydata()'>
.....
</form>
</body>
</html>
talk to you later,
Will
-----Original Message-----
From: ShriKant Vashishtha [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 12, 2001 11:27 PM
To: [EMAIL PROTECTED]
Subject: Urgent !!!!!!!! Please help me
Hi,
My JSP contains the following things
A text box
and a GO button which fetches the result based on the criteria entered in
textbox.
The GO button has a validation for a blank search criteria and displayes
alert
message if we press GO without entering anything.
But the problem is, if I hit on ENTER, it fetches me the result even if I
haven't entered anything in the text box. It does not go through the
validation which executes on pressing on GO button.
Please help...........
-ShriKant
===========================================================================
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
===========================================================================
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