Hello, I am trying to use onkeypress on an input type="text" control to fire off some javascript if the enter button is pressed. It works on most pages, but I also have some pages with custom .NET controls.
The problem is that the .NET submit fires before the onkeypress. Does anybody have an insight on how to make onkeypress fire first?
If it helps, here is my javascript:
function SearchSiteSubmit(myfield, e)
{
var keycode;
if (window.event)
keycode = window.event.keyCode;
else if (e)
keycode = e.which;
else
return true;
if (keycode == 13)
{
SearchSite();
return false;
}
else
return true;
}