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 Quote Link to comment 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> Quote Link to comment Share on other sites More sharing options...
ted_chou12 Posted September 9, 2010 Author Share Posted September 9, 2010 thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.