jaymc Posted November 8, 2007 Share Posted November 8, 2007 I need to have a textarea that doesnt break to a newline when you press enter When you press enter I want it to submit the form I only want it to break to a new line if you do shift and enter Is there a way to do this? Quote Link to comment Share on other sites More sharing options...
mainewoods Posted November 9, 2007 Share Posted November 9, 2007 javascript offers the onkeydown, onkeyup, and onkeypress events you could use: http://www.quirksmode.org/js/events_compinfo.html#keys never coded it, don't have any code for you. Quote Link to comment Share on other sites More sharing options...
jaymc Posted November 9, 2007 Author Share Posted November 9, 2007 IS there a way to check what the actual key is I could do onkeydown if press return do nothing Basically Quote Link to comment Share on other sites More sharing options...
obsidian Posted November 9, 2007 Share Posted November 9, 2007 Try googling for trapping keystrokes. Here is something that might help: http://sniptools.com/jskeys Quote Link to comment Share on other sites More sharing options...
jaymc Posted November 9, 2007 Author Share Posted November 9, 2007 Excellent 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.