M
majsen
Hi all,
i have a problem. The user will fill in som textboxes in a form with
a submit button. When the user click the button the form submits
and my asp script fires...
if not isempty(Request.Form("search")) then
....
....
end if
but if the user click the return tab the page just reload and the
abowe asp
script does not catch the event.
I tryh to use this script below without success...
<SCRIPT TYPE="text/javascript">
<!--
function submitenter(myfield,e)
{
var keycode;
if (window.event) keycode = window.event.keyCode;
else if (e) keycode = e.which;
else return true;
if (keycode == 13)
{
form1.search.submit();
return false;
}
else
return true;
}
//-->
</SCRIPT>
<form name="form1" method="post" action="./searchResult.asp">
<input name="omrade" type="text" id="omrade" size="18"
onKeyPress="return submitenter(this,event)">
<input type="submit" name="search" value=" Sök " >
</form>
How can i get it to work?
Regards Majsen
i have a problem. The user will fill in som textboxes in a form with
a submit button. When the user click the button the form submits
and my asp script fires...
if not isempty(Request.Form("search")) then
....
....
end if
but if the user click the return tab the page just reload and the
abowe asp
script does not catch the event.
I tryh to use this script below without success...
<SCRIPT TYPE="text/javascript">
<!--
function submitenter(myfield,e)
{
var keycode;
if (window.event) keycode = window.event.keyCode;
else if (e) keycode = e.which;
else return true;
if (keycode == 13)
{
form1.search.submit();
return false;
}
else
return true;
}
//-->
</SCRIPT>
<form name="form1" method="post" action="./searchResult.asp">
<input name="omrade" type="text" id="omrade" size="18"
onKeyPress="return submitenter(this,event)">
<input type="submit" name="search" value=" Sök " >
</form>
How can i get it to work?
Regards Majsen