Click here to Skip to main content
Click here to Skip to main content

Tagged as

Go to top

Find the key code using javascript

, 23 Nov 2011
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'); 
        }         
    }

License

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

Share

About the Author

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

Comments and Discussions

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