This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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


JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Capturing "Enter Key" Value in Javascript" Watch "Capturing "Enter Key" Value in Javascript" New topic
Author

Capturing "Enter Key" Value in Javascript

Gurpreet Sidhu
Greenhorn

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
author
Rancher

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

Eric
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Capturing "Enter Key" Value in Javascript
 
It's not a secret anymore!