ted_chou12 Posted September 9, 2010 Share Posted September 9, 2010 Hi, I made a textfield that is made to do a certain thing when a key is pressed as onKeydown="event.keycode==13...", so that's when the enter key is pressed, but I am not sure how you can terminate the onKeyUp function such that when the key is released, the "enter" key does not effect the textarea: <<the textarea skips a line eventhough func is passed successfully Ted Chou Link to comment https://forums.phpfreaks.com/topic/212977-terminate-onkeyup-after-onkeydown/ Share on other sites More sharing options...
Psycho Posted September 9, 2010 Share Posted September 9, 2010 I'm not entirely understanding your question, but do a return false if you don't want the return key to submit the form. Example page: <html> <head> <script type="text/javascript"> function keyDownFunction() { if(window.event.keyCode=='13') { return false; } } </script> </head> <body> <form action="here.php" method="POST"> <input type="text" name="dfsf" onkeydown="return keyDownFunction();" /> <button type="submit">Submit</button> </body> </html> Link to comment https://forums.phpfreaks.com/topic/212977-terminate-onkeyup-after-onkeydown/#findComment-1109346 Share on other sites More sharing options...
ted_chou12 Posted September 9, 2010 Author Share Posted September 9, 2010 thanks Link to comment https://forums.phpfreaks.com/topic/212977-terminate-onkeyup-after-onkeydown/#findComment-1109386 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.