Deactivating Return

Discussion in 'HTML' started by Daniel Pomrehn, Nov 25, 2003.

  1. Hello,

    on the website www.oliver.clarehn-baeren.de/index.php it is necessary that
    the Return Key isn't used to send the form. The user must click on the "Ja"
    Button. In other ways the PHP Script does'nt work probably. Can anyone tell,
    how I can deactivate the return key?

    Thank you
    Daniel Pomrehn
     
    Daniel Pomrehn, Nov 25, 2003
    #1
    1. Advertising

  2. Daniel Pomrehn

    Jay Guest

    "Daniel Pomrehn" <> wrote in message
    news:bq095s$1tcpa0$-berlin.de...
    > Hello,
    >
    > on the website www.oliver.clarehn-baeren.de/index.php it is necessary that
    > the Return Key isn't used to send the form. The user must click on the

    "Ja"
    > Button. In other ways the PHP Script does'nt work probably. Can anyone

    tell,
    > how I can deactivate the return key?


    How do you expect someone who doesn't/can't use a mouse to submit your
    form???

    - J
     
    Jay, Nov 25, 2003
    #2
    1. Advertising

  3. Daniel Pomrehn

    Steve Pugh Guest

    "Daniel Pomrehn" <> wrote:

    >on the website www.oliver.clarehn-baeren.de/index.php it is necessary that
    >the Return Key isn't used to send the form. The user must click on the "Ja"
    >Button. In other ways the PHP Script does'nt work probably. Can anyone tell,
    >how I can deactivate the return key?


    If that's true then there's something wrong with the PHP script. Fix
    that, don't try to cripple the browser.

    Steve

    --
    "My theories appal you, my heresies outrage you,
    I never answer letters and you don't like my tie." - The Doctor

    Steve Pugh <> <http://steve.pugh.net/>
     
    Steve Pugh, Nov 25, 2003
    #3
  4. Daniel Pomrehn

    Kris Guest

    In article <bq095s$1tcpa0$-berlin.de>,
    "Daniel Pomrehn" <> wrote:

    >
    > on the website www.oliver.clarehn-baeren.de/index.php it is necessary that
    > the Return Key isn't used to send the form. The user must click on the "Ja"
    > Button. In other ways the PHP Script does'nt work probably. Can anyone tell,
    > how I can deactivate the return key?


    Fix your server side script. Form submission is enough, there is no need
    for checking whether the "ja" button was pressed. You don't need to
    break the return key and attempt to take away a core function of the
    browser.

    <?
    if($name)
    {
    //form was submitted
    }
    ?>

    --
    Kris
    erlands (nl)
     
    Kris, Nov 25, 2003
    #4
  5. Daniel Pomrehn wrote:
    > Hello,
    >
    > on the website www.oliver.clarehn-baeren.de/index.php it is necessary
    > that the Return Key isn't used to send the form. The user must click
    > on the "Ja" Button. In other ways the PHP Script does'nt work
    > probably. Can anyone tell, how I can deactivate the return key?
    >
    > Thank you
    > Daniel Pomrehn


    Dont know why you would..... but any way, this may work for you....


    Firstly, you need ne understand that the first <input> in a <form> that is a
    'submit' type, will be the one that 'catches' the return key when on a field
    (<input type of text>).
    What you may be able to do, is to paint yourself another input submit
    earlier in the form (before the original button), giving it a different
    name, and when submitted, simply do not do what the other button would
    normally do.

    like this.....


    <form action="script.php">
    <input name=mytextfield" type="text">
    <input name="dummybutton" type="submit" value="">
    <input name="realbutton" type="submit" value="the real one">
    </form>

    .... in the above example, the button named "dummybutton" will catch the
    'return' key because it is painted first in the <form>

    ....now, you have the option to either put a javascript in the button to say
    something like "onclick, piss off", or you could have something in your
    script .php file that says something like if (isset($dummybutton){ echo
    "piss off";}
     
    Disco Octopus, Nov 26, 2003
    #5
    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. PvdK
    Replies:
    0
    Views:
    2,985
  2. wl
    Replies:
    2
    Views:
    588
    Dimitri Maziuk
    Mar 5, 2004
  3. Ganesh Gella
    Replies:
    4
    Views:
    364
    Stuart Gerchick
    Nov 12, 2004
  4. Seong-Kook Shin
    Replies:
    1
    Views:
    498
    Richard Bos
    Jun 18, 2004
  5. Greenhorn
    Replies:
    15
    Views:
    839
    Keith Thompson
    Mar 6, 2005
Loading...

Share This Page