...

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



Spaull69
05-06-2009, 10:59 AM
Hi

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?

[CODE]
<html>
<head>
<script language=javascript >

function changeF(url) {
parent.frames['I1'].location.href = url + ".htm"
}
</script>
</head>

<body>
<BODY>

<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>
</form>
<p>&nbsp;</p>
<p>&nbsp;</p>
</body>
</html>
[CODE]

brazenskies
05-06-2009, 01: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;">

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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum