PDA

View Full Version : click only submit button?


sepulchrave
01-14-2006, 04:57 PM
Hi - when you type Japanese you first type it phonetically and then
press enter to change it to kanji. Because of this, many Japanese users on the site I just built are submitting forms before they're filled out. How do I change my submit button so it does not respond to keyboard input?
Thanks,
Sepulchrave

Creative Insanity
01-14-2006, 05:26 PM
Man that is a good question and one I don't have the answer to.
DJ you can tackle this one.

davidj
01-16-2006, 08:00 AM
try this...

//if you press return do nothing
if(event.keyCode==13){
event.keyCode = null;
}
//if you press return replace keycode 13 with 9 (tab)
if(event.keyCode==13){
event.keyCode = 9;
}

KeyCode 13 is the return key which evals to null if it is pressed then it changes the focus to another element

you could wrap this in a function and call it from the <body> tag using an onKeypress event

Creative Insanity
01-16-2006, 08:51 AM
Hell! nice thinking dj. I would of never thought of that in a trillion years.

sepulchrave
01-17-2006, 12:20 AM
Wow.
Very cool.
Thank you.
Joy reigns.
:D
Sep.