View Full Version : Cant use Enter??????

05-06-2009, 11:59 AM

I am using a very simple search-type page to enable users to input a model number and its page appears in a inline frame. Its not a true search as it is simply relying on a person entering the correct html page name to find it. But this works perfectly in my application.

The problem I have is that I cannot get the type box to accept enter key as a submitt, only a click of the mouse will submitt the request. If enter is pressed the box loses the users input but no action is taken.

I think this may be a javascript issue. I have posted the code below.

Can anyone help?

<script language=javascript >

function changeF(url) {
parent.frames['I1'].location.href = url + ".htm"


<form name="form1" method="get">
<p align="right">
<input type="input" name="test" value="" alt="Please use lower case and no spaces in your search. use simple terms such as motor, pump, d661 etc etc">
<input type="submit" name="hi" value="Search By Model Name" onclick="changeF(document.form1.test.value)">
<img src="images/info-symbol.gif" width="23" height="22" alt="Please use lower case only, and keep search terms simple. e.g. pump or g761">&nbsp; or use the drop down menu</p>

05-06-2009, 02:15 PM
When you hit enter does the page reload?

I had a similar problem and this fixed it...

<input type="submit" name="hi" value="Search By Model Name" onclick="changeF(document.form1.test.value);return false;">

05-06-2009, 09:14 PM
Closed. Thread cross posted here: http://www.codingforums.com/showthread.php?t=165635