That form probably has a submit button that has a parameter name="...". The script might be checking for that param('...').
If the form is submitted by pressing the button, that parameter from the submit button is sent to the server while if the form is submitted by pressing enter from another form field, it is not, so the script will fail when checking for it. The solution is to put another hidden field like <input type="hidden" name="..." value="..."> and remove the name="..." parameter from the submit tag. Teddy, Teddy's Center: http://teddy.fcc.ro/ Email: [EMAIL PROTECTED] ----- Original Message ----- From: "Hughes, Andrew" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, April 01, 2003 6:31 PM Subject: form user interface issue I have a form that I am using to add data to a mysql database table. I am using a .pl scrtipt to generate the html. I am using cgi.pm and param() to insert the form data. And, I am using to the print<<HTML; function to display my forms within the .pl script. The problem is that when the user completes the form and hits the enter key (as opposed to the mouse to submit the form), the form goes blank and nothing happens. However, if a user uses the mouse, everything works fine. Please let me know what you think the problem is. Any assistance would be greatly appreciated. Thanks, Andrew Here's the code: ..snip1.. my $choice = lc(param("choice")); my $check_email = WebDB::trim_and_collapse_whitespace (lc(param("check_email"))); ..snip1.. ..snip2.. if ($choice eq "") { checkemailform(); # displays form } elsif ($choice eq "check") { checkemail(); # inserts the data } ..snip2.. ..snip3.. sub checkemailform { print "Content-type:text/html\n\n"; print <<checkemailform; <html> <head> <title>Insider's Advantage</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> <!-- .main {font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; font-weight: normal; color: #000000;} .mainsmall {font-family: Arial, Helvetica, sans-serif; font-size: 10px; color: #000000;} .head {font-family: Arial, Helvetica, sans-serif; font-size: 14px; font-weight: bold; color: #000000;} --> </style> <SCRIPT LANGUAGE=JAVASCRIPT TYPE="TEXT/JAVASCRIPT"> function submitIt(form) { if (!validEmail(form.check_email.value)) { alert("Invalid AOLTW Business E-Mail Address.") form.check_email.focus() form.check_email.select return false } } function validEmail(check_email) { invalidChars = " /:,;" if (check_email =="") { return false } for (i=0; i<invalidChars.length; i++) { badChar = invalidChars.charAt(i) if (check_email.indexOf(badChar,0) > -1) { return false } } atPos = check_email.indexOf("@",1) if (atPos == -1) { return false } if (check_email.indexOf("@",atPos+1) > -1) { return false } periodPos = check_email.indexOf(".",atPos) if (periodPos == -1) { return false } if (periodPos+3 > check_email.length) { return false } return true } //end validEmail </SCRIPT> </head> <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <form method="post" action="2003springcontest.pl" onSubmit="return submitIt(this)"> <table width="500" border="0" align="center" cellpadding="2" cellspacing="0"> <tr> <td colspan="2" class="main" align="center"><img src="http://insidersadvantage.com/images/promotions/2003brochure/signup_head .jpg" border="0"></td> </tr> <tr> <td colspan="2" class="main">Please enter your work email address below so that we may determine whether or not you are an E-Club member. </td> </tr> <tr> <td colspan="2" class="main">* <i> <b>Indicates a required field.</b></i></td> </tr> <tr> <td width="175" align="right" class="main">Work Email Address:</td> <td width="325" class="main"> <input type="text" name="check_email" maxlength="60"> *</td> </tr> <tr> <td colspan="2" align="center"><input type="submit" name="choice" value="Check"> </td> </tr> <tr> <td colspan="2" class="main"> </td> </tr> </table> </form> </body> </html> checkemailform } ..snip3.. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]