function delete_all_check()
{
var prompt = window.confirm("Are you sure you want to delete all the local oui entries?");
if (prompt)
{
document.forms[0].refresh_in_progress.value = 1;
document.forms[0].refresh_key.value = 4;
document.forms[0].submit();
}
}我写了这样的函数,当我点击delete all时,有个框弹出,我点击取消,内容会被删掉,确定却删除不了,为什么?
{
var prompt = window.confirm("Are you sure you want to delete all the local oui entries?");
if (prompt)
{
document.forms[0].refresh_in_progress.value = 1;
document.forms[0].refresh_key.value = 4;
document.forms[0].submit();
}
}我写了这样的函数,当我点击delete all时,有个框弹出,我点击取消,内容会被删掉,确定却删除不了,为什么?
解决方案 »
- 用JQuery删除Div在IE没问题,在Firefox有奇怪问题(需要在页面任何一处单击左键DIV才消失),请高手分析下原因,并给出解决方案,谢谢!
- ext4表单提交中文乱码问题,如何解决?
- eval 获得对象用法 请教达人
- Extjs上传文件成功后关闭窗体出现的问题
- 关于复制的内容,里面控件name属性如何定义?
- EXTJS提交表单出现的问题?
- 高手来看看,这个页面的翻页效果很不错,怎么做的?????
- 打印问题.大家一定要帮忙呀.斑竹
- 请教各位大虾JS的怪问题!!
- 怎么实现新开小窗口自动最小化功能?在线等待!多谢各位大侠!!
- jquery实现类似于visio的功能??
- 请教如何在JS中调用后台方法
function delete_all_check()
{
var prompt = window.confirm("Are you sure you want to delete all the local oui entries?");
if (!prompt)
{
document.forms[0].refresh_in_progress.value = 1;
document.forms[0].refresh_key.value = 4;
document.forms[0].submit();
}
}
你点取消的话,,prompt为false;也就不会进if里面
加上!号就行了
if(confirm("Are you sure you want to delete all the local oui entries?"))
{
document.forms[0].refresh_in_progress.value = 1;
document.forms[0].refresh_key.value = 4;
document.forms[0].submit();
}
<script>
function myconfirm(){
if(!confirm("Are you sure you want to delete all the local oui entries?")){ return false; }
}
</script>
<form>
....................
<input type=submit id=a name=a value=删除 onclick='return myconfirm();'>
</form>onclick='return myconfirm();'
注意红字用法
onclick='return delete_all_check()'
因为确定后走了下面的代码,
document.forms[0].refresh_in_progress.value = 1;
document.forms[0].refresh_key.value = 4;
document.forms[0].submit();
这有影响吗?