Alicia Posted February 3, 2010 Share Posted February 3, 2010 Hi, I wanted to replace the textfield in the script below to textarea but then the javascript function will stop working. How can I make the textarea works as the textfield when the enter key is pressed ? Please advise. or is there any way i can increase the lines of the textfield? <script> function handleEnter(e) { var characterCode; if(e && e.which) { e = e; characterCode = e.which; } else { e = event; characterCode = e.keyCode; } if(characterCode == 13) { document.forms["myform"].submit(); return false; } else { return true; } } </script> <form id="myform" action="submit-form.php" method="get"> <p>Search: <input type='textarea' name='query'> </p> <p> <label> <input type="submit" name="button" id="button" value="Submit"> </label> </p> </form> Quote Link to comment Share on other sites More sharing options...
Alicia Posted February 3, 2010 Author Share Posted February 3, 2010 anyone? 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.