本文介绍了javascript表单提交控制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
朋友,
我在.aspx页面中有删除按钮.
删除;
并且我的页面中有一个表单.
检查功能会使用javascript
显示确认(确定吗")
现在,我想如果有人打不出任何表格,就不要提交.如果命中,则应提交是"表格.
帮帮我......
hi friends,
i have delete button in my .aspx page.
Delete;
and i have a form in my page.
the check function shows a confirm("are you sure") using javascript
now i want if anyone hit the no form should not get submit. and if hits Yes form should be submitted.
help me.....
推荐答案
<button type="submit" value="Delete" önclick="return Check()">Delete</button>;
(2)如果用户单击是",则在Check()函数中提及"return true".同样,如果他单击否",则返回false.
(2) In the Check() function mention "return true" if user clicks YES. Simillarly, if he clicks NO then return false.
function Check()
{
// confirm return true of false
var chk=confirm("Are you sure");
// if true
if(chk)
document.forms.submit();
}
这篇关于javascript表单提交控制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!