I was wondering how we can lock a multi-line text box from enter key, i.e. when the user presses enter on my multi-line text book, it doesn't takes the cursor to a new line but instead stay at the same line. Actually I am trying to use a multi-line text book as a single-line text book ( for designing purposes ). I remember doing it back in the days, can't figure it right now
I found only this code that works in IE6 for me: <html> </head> <body> <script type="text/javascript"> function noEnter(e){ if (e.keyCode == 13 ) { event.returnValue = false; } } </script> <form> <textarea onkeypress="noEnter(event)" /></textarea> </form> </body> </html> Code (markup): Try google with "javascript block key" or "javascript detect keypress" and similar.