How to submit a form on pressing enter key

Posted by SAMIR BHOGAYTA on Samir ASP.NET with C# Technology See other posts from Samir ASP.NET with C# Technology or by SAMIR BHOGAYTA
Published on 2010-03-03T02:12:00.000-08:00 Indexed on 2010/12/06 17:00 UTC
Read the original article Hit count: 504

function clickButton(e, buttonid)
{
var bt = document.getElementById(buttonid);
if (typeof bt == 'object'){
if(navigator.appName.indexOf("Netscape")>(-1)){
if (e.keyCode == 13){
bt.click();
return false;
}
}
if (navigator.appName.indexOf("Microsoft Internet Explorer")>(-1))
{
if (event.keyCode == 13){
bt.click();
return false;
}
}
}
}

//Call this function on last text box of a form with onKeyPress="clickButton(this)"


© Samir ASP.NET with C# Technology or respective owner

Related posts about How to submit a form on p