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? Link to comment https://forums.phpfreaks.com/topic/76529-solved-textarea/ 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. Link to comment https://forums.phpfreaks.com/topic/76529-solved-textarea/#findComment-387894 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 Link to comment https://forums.phpfreaks.com/topic/76529-solved-textarea/#findComment-387977 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 Link to comment https://forums.phpfreaks.com/topic/76529-solved-textarea/#findComment-387980 Share on other sites More sharing options...
jaymc Posted November 9, 2007 Author Share Posted November 9, 2007 Excellent Link to comment https://forums.phpfreaks.com/topic/76529-solved-textarea/#findComment-387984 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.