Avatar of Ryan Rood
Ryan Rood
Flag for Canada

asked on 

Submit Form Using Enter Or Clicking Submit


I have a form that I am submitting (see code attached), however when I press enter it just refreshes the page and doesn't actually submit the form. I find this very inconvenient as I myself always use the enter key. We use IE6 or IE7.

Any advice on how to correct this behaviour?

<title>Customer Search</title>
<body background="../background.png" onLoad=dofo() alink="blue" vlink="blue">
<script type="text/javascript">
function dofo() {
<div align="center">
<a href="http://intranet/search"><img src="../logo.png" border="0" alt=""></a>
	<td><a href="#" onClick="history.go(-1)">Back</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://intranet" alt="Intranet Home">Home</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="list_all.php">Show All</a></td>
<form name="fo" method="POST" action="search.php">
		<strong>Enter Customer Information</strong><br><br>
		<input type="text" name="keyword" size="20" maxlength="100">
		<input type="submit" name="submit" value="Search" />

Open in new window

PHPScripting Languages

Avatar of undefined
Last Comment
Ryan Rood

8/22/2022 - Mon