Admin Admin
Number of posts : 216 Registration date : 2007-01-01
| Subject: DefaultButton , On Enter Press Raise Default Button Event Wed Dec 05, 2007 11:29 pm | |
| On the top of your page add - Code:
-
<head> <script language="JavaScript" type="TEXT/JAVASCRIPT"> <!-- //For Button function DefaultButton(evnt, buttonId){
var evt = evnt ? evnt : window.event;
var bt = document.getElementById(buttonId);
if (bt){
if (evt.keyCode == 13){
bt.click();
return false;
}
}
};
//For Link Button function DefaultLinkButton(evnt, buttonId){
var evt = evnt ? evnt : window.event;
var bt = document.getElementById(buttonId);
if (bt){
if (evt.keyCode == 13){
eval(bt.href); return false;
}
}
}; //--> </script> </head> | |
|