Deactivating Return

D

Daniel Pomrehn

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
 
J

Jay

Daniel Pomrehn said:
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
 
S

Steve Pugh

Daniel Pomrehn said:
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
 
K

Kris

Daniel Pomrehn said:
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
}
?>
 
D

Disco Octopus

Daniel said:
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";}
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top