Problem with submit

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&ouml;k " >
</form>

How can i get it to work?
Regards Majsen
 
E

Evertjan.

majsen wrote on 10 mei 2004 in microsoft.public.inetserver.asp.general:
if not isempty(Request.Form("search")) then

if Request.Form("search") <> "" then
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top