Form won't submit when pressing enter key

From: Date: Thu, 16 Jan 2003 01:23:26 +0000
Subject: Form won't submit when pressing enter key
Groups: php.general 
Request: Send a blank email to php-general+get-131791@lists.php.net to get a copy of this message
I have a form created by this code (I don't know if it's important): if ($_POST["submit"]) { //do form stuff } else { echo "<html>"; echo "<head>"; echo "<title>Form</title>"; echo "</head>"; echo "<body>"; echo "<h3>Lookup Customer</h3>"; echo "Enter the customer's <u>home</u> phone number:<br/>"; echo "<form action=\"$PHP_SELF\" method=\"post\">"; echo "<input type=\"text\" name=\"phone\" size=\"10\"> "; echo "<input type=\"submit\" name=\"submit\" value=\"Search\">"; echo "</form>"; echo "</body>"; echo "</html>"; } After you fill out the only field, you HAVE to click the submit button to submit the form. If you press enter to submit the form it reloads the form and clears out the info that was entered. I can't figure out why this is happening and I need to make it submit using the enter key and I don't want to do something fancy with javascript at all. Please help Thanks, Sarah

« previous php.general (#131791) next »