javascript代码不支持表单onsubmit事件, [英] javascript code not support form onsubmit event,
本文介绍了javascript代码不支持表单onsubmit事件,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<form id="form1" runat="server" onsubmit="fun('postback',event)">
<script type="text/javascript">
function fun(data, event) {
if (data == "postback") {
window.onbeforeunload = function () { }
// window.form1.submit();
}
else if (data == "notpostback") {
if (aClick == "false") {
ajaxCall();
alert("Logged Out");
return true;
}
}
}
</script>
这可以正常使用chrome但按钮点击不能在firefox中工作。
plz帮帮我,
This is working fine with chrome but button click not working in firefox.
plz help me,
推荐答案
尝试如下。
Try is as below.
<form id="form1" runat="server">
<button type="submit" class='input_submit' onClick="fun('postback')">Save</button>
</form>
我希望这会对你有所帮助。
I hope this will help to you.
这篇关于javascript代码不支持表单onsubmit事件,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文