wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes Capturing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Capturing "Enter Key" Value in Javascript" Watch "Capturing "Enter Key" Value in Javascript" New topic

Capturing "Enter Key" Value in Javascript

Gurpreet Sidhu

Joined: Nov 21, 2007
Posts: 3
If i press Enetr key in my Text Area Field . Its passing the enter key value to database. I want to capture that value and change it to " " space. How can i capture my "Enter Key " value in Javascript?/
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15376
You should be doing it on the server and not the client. You need a basic regular expression replaceAll("\\n"," ");

Consider Paul's rocket mass heater.
subject: Capturing "Enter Key" Value in Javascript
Similar Threads
Audit Trail for Web Application
How to trap the Print Screen
Enter Key Code
hitting the enter on the keyBoard should default to "YES" button on the html/jsp page
Submitting with "Enter" from textbox where there are several submit buttons on form