Click here to Skip to main content
11,932,734 members (55,759 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


1 bookmarked

Find the key code using javascript

, 23 Nov 2011 CPOL
Rate this:
Please Sign up or sign in to vote.
In Text box key press event, find the pressed key code value using javascript
<input type="text" id="txtSearch"  önkeypress="searchKeyPress(event);" />
function searchKeyPress(e)         
        // look for window.event in case event isn't passed in
        if (window.event) { e = window.event; }
        if (e.keyCode == 13) {
           alert('Enter key pressed on the Text Box control'); 


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Ramanujam Shankar
Web Developer Mahindra Logisoft Business Solution Limited, Chenn
India India
No Biography provided

You may also be interested in...

Comments and Discussions

-- There are no messages in this forum --
| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.151126.1 | Last Updated 23 Nov 2011
Article Copyright 2011 by Ramanujam Shankar
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid