I am using the following code. It works in IE, but the button click event is not properly generated in Firefox Is:
function call center (BTN, HDN, event) {var key; Var isIE = true; Debugger; If (window.event) {key = window.event.keyCode; // IE IEE = true; } And {key = event.which; // Firefox IE = is incorrect; } If (key == 13) {var btn = document.getElementById (BTN); If (btn! = Null) {// If we have found the button, then click on this document .getElementById (hdn) .value = '1' btn.click (); Key = 0; }} }
I think your function Wrong parameters Try it:
Function Trap Entter (E) {E = E || Window.event || accident; Var code = E.Carcode || E. Cacode || E.which; If (code == 13) {var btn = document.getElementById ('& lt;% = yourButtonID.ClientID% & gt;'); If (btn! = Null) {// If we find that you click on the button, then document.getElementById (hdn) .value = '1'; Btn.click (); Key = 0; }}}
Comments
Post a Comment