sayedsohail Posted September 18, 2007 Share Posted September 18, 2007 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.