troubleshooting Question

Submit Form Using Enter Or Clicking Submit

Avatar of Ryan Rood
Ryan RoodFlag for Canada asked on
PHPScripting Languages
34 Comments1 Solution1754 ViewsLast Modified:
Hello,

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?

Thanks,
Ryan
<html>
<title>Customer Search</title>
<body background="../background.png" onLoad=dofo() alink="blue" vlink="blue">
<head>
<script type="text/javascript">
 
function dofo() {
	document.fo.keyword.focus();
}
 
</script>
</head>
<div align="center">
<a href="http://intranet/search"><img src="../logo.png" border="0" alt=""></a>
<br>
 
 
<tr>
	<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>
</tr>
<form name="fo" method="POST" action="search.php">
	<table>
		<strong>Enter Customer Information</strong><br><br>
		<input type="text" name="keyword" size="20" maxlength="100">
		<input type="submit" name="submit" value="Search" />
	</table>
</form>
</div>
</body>
</html>
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 34 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 34 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros