Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Submit form on enter not working right

Status
Not open for further replies.

Melissahomes

Programmer
May 13, 2005
8
US
I have 2 asp pages. Search.asp, formsearch.asp


I want to form to submit when I hit enter. It seems to submit on enter and goes to the formsearch.asp but nothing happends. But when I hit submit button it works fine. Can someone tell me what's wrong? Thanks guys.

Search.asp (code)

<html>
<head>
<SCRIPT LANGUAGE="javascript">
function send()
{document.form1.submit()}
</SCRIPT>

<title>Untitled Document</title>

</head>

<body>

<form name="form1" method="post" action="formsearch.asp">
<input name="searchCriteria" type="text" onUnfocus="send()">
<select name="site" id="site">
<option value=" <option value=" <option value=" Dictionary</option>
<option value=" Info</option>
<option value=" Dictionary</option>
<option value=" Thesaurus</option>
</select>
<input name="Search" type="submit" id="Search" value="Search">
</form>


</body>
</html>



formsearch.asp (code)

<%
if len(request.form("Search")) then
dim newRoute
newRoute = request.form("site")
newRoute = newRoute & server.URLEncode(request.form("searchCriteria"))
response.redirect(newRoute)
end if


%>
 
First, this is NOT an ASP question. Second, there is no "onunfocus()" event handler in Javascript (where this questions should REALLY be). The event handler is onblur().

Lee
 
still did not work. anyway i posted in the correct forum.

thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top