Jump to content

keypress not working?


sayedsohail

Recommended Posts

Here is my code, i am not sure why this is not working? I am calling this script below inside a div using ajax and when i press enter inside the div nothing happens and no errors are displayed.

 

<

html>
<head>
<script>
function entsub(evt) {
var key = (evt) ? evt.which : event.keyCode;
if (key == 10 || key == 13) {
    if (document.getElementById('search').value == '') window.close();
    else searchwextended();
}
}

</script>
</head>
<body id='search' onKeyPress="entsub(event);">
<p>
Search the Clients database:<br />
<INPUT type='text' size='30' id='search' name='search' autocomplete='off' >
<INPUT type='button' value='Search' 
onClick="javascript:entsub(event);"></p>
</body>
</html>

Link to comment
https://forums.phpfreaks.com/topic/69743-keypress-not-working/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.