//文本框回车时取消按钮事件 <asp:TextBox ID="txtCheckAutograph" runat="server" οnkeypress="return CancelClick();"></asp:TextBox>
function CancelClick() {
var evt = GoEvent();
if (evt.keyCode == 13) {
return false;
}
}
function GoEvent() {
if (document.all)
return window.event;
func = getEvent.caller;
while (func != null) {
var arg0 = func.arguments[0];
if (arg0) {
if ((arg0.constructor == Event || arg0.constructor == MouseEvent)
|| (typeof (arg0) == "object" && arg0.preventDefault && arg0.stopPropagation)) {
return arg0;
}
}
func = func.caller;
}
return null;
}
function CancelClick() {
var evt = GoEvent();
if (evt.keyCode == 13) {
return false;
}
}
function GoEvent() {
if (document.all)
return window.event;
func = getEvent.caller;
while (func != null) {
var arg0 = func.arguments[0];
if (arg0) {
if ((arg0.constructor == Event || arg0.constructor == MouseEvent)
|| (typeof (arg0) == "object" && arg0.preventDefault && arg0.stopPropagation)) {
return arg0;
}
}
func = func.caller;
}
return null;
}