Hi there
I have a form with various inputs (txt, checkbox, textarea, submits). My problem revolves around the textarea. If a user wants to add a double line between paragraphs by hitting the enter key twice, the form is submitted on the second enter. (this behaviour is present in both IE7 and Firefox)
could someone please tell me how i can stop this annoying behaviour? I have tried some scripts to disable the key, however the user still needs to be able to add these double lines and most scripts disable the action, eg
I notice the textarea i am currently typing into here at tek-tips does not have this issue..
Cheers
in advance
Tracey
Remember... True happiness is not getting what you want...
Its wanting what you have got!
I have a form with various inputs (txt, checkbox, textarea, submits). My problem revolves around the textarea. If a user wants to add a double line between paragraphs by hitting the enter key twice, the form is submitted on the second enter. (this behaviour is present in both IE7 and Firefox)
could someone please tell me how i can stop this annoying behaviour? I have tried some scripts to disable the key, however the user still needs to be able to add these double lines and most scripts disable the action, eg
Code:
function handleEnter(field, event) {
var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
if (keyCode == 13) {
return false;
}
else
return true;
}
I notice the textarea i am currently typing into here at tek-tips does not have this issue..
Cheers
![[cheers] [cheers] [cheers]](/data/assets/smilies/cheers.gif)
Tracey
Remember... True happiness is not getting what you want...
Its wanting what you have got!