Problem with submit

Discussion in 'ASP General' started by majsen, May 10, 2004.

  1. majsen

    majsen Guest

    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
    majsen, May 10, 2004
    #1
    1. Advertising

  2. majsen

    Evertjan. Guest

    majsen wrote on 10 mei 2004 in microsoft.public.inetserver.asp.general:

    > if not isempty(Request.Form("search")) then
    >


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


    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., May 10, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mark
    Replies:
    1
    Views:
    1,670
  2. Ghafran Abbas
    Replies:
    0
    Views:
    4,183
    Ghafran Abbas
    Oct 12, 2004
  3. The Crow
    Replies:
    2
    Views:
    4,353
    Bruce Barker
    Sep 27, 2005
  4. Megha Vishwanath
    Replies:
    2
    Views:
    9,801
    tutorialsmaster
    Oct 2, 2009
  5. Joop
    Replies:
    5
    Views:
    570
Loading...

Share This Page