Deactivating Return

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

on the website 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

Re: Deactivating Return

Quoted text here. Click to load it
Quoted text here. Click to load it

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

- J

Re: Deactivating Return

Quoted text here. Click to load it

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


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

Re: Deactivating Return

Quoted text here. Click to load it

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

   //form was submitted

kristiaan@xs4all.netherlands (nl)

Re: Deactivating Return

Daniel Pomrehn wrote:
Quoted text here. Click to load it

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">

... in the above example, the button named "dummybutton" will catch the
'return' key because it is painted first in the <form>, 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";}

Site Timeline