javascript JS 中confirm 确定 取消 按钮替换成 是 否 取消
通常用js 中confirm实现弹出对话框确定取消
<script language="Javascript">
function preview()
{
var bln=confirm("需要打印签核流程吗?")
if (bln==true)
{ }
else
{ }
}
</script>
function preview()
{
var bln=confirm("需要打印签核流程吗?")
if (bln==true)
{ }
else
{ }
}
</script>
有的时候需要把 “确定”“取消” 替换成 “是” “否” “取消”
<SCRIPT LANGUAGE="vbscript">
function show(str)
show=msgbox(str,3,"提示")
//是 6
//否 7
//取消 2
end function
</SCRIPT>
<script language="Javascript">
function preview()
{ var bln;
bln=show("是否要将签核过程打印在页面后?")
switch(bln)
{ case 6:
SignTR.className='';
break;
case 7:
SignTR.className='NOPRINT';
break;
case 2:
return; }
}
</script>
function show(str)
show=msgbox(str,3,"提示")
//是 6
//否 7
//取消 2
end function
</SCRIPT>
<script language="Javascript">
function preview()
{ var bln;
bln=show("是否要将签核过程打印在页面后?")
switch(bln)
{ case 6:
SignTR.className='';
break;
case 7:
SignTR.className='NOPRINT';
break;
case 2:
return; }
}
</script>
如果用上language=vbscript 当鼠标划过menu的时候网页左下角会出错,如果改成javascript就OK 了
<script language="Javascript">
function show(str)
{
execScript("n = msgbox('"+str+"',3,'提示')","vbscript");
return(n);
}
</script>
function show(str)
{
execScript("n = msgbox('"+str+"',3,'提示')","vbscript");
return(n);
}
</script>
只有“是”“否”,还有其他情况可参考vbscript的msgbox
<script language=javascript>
function window.confirm(str)
{
execScript("n = (msgbox('"+ str +"',vbYesNo, '自定的confirm')=vbYes)", "vbscript");
return(n);
}
alert(confirm("重载的confirm弹出框"));
</script>
function window.confirm(str)
{
execScript("n = (msgbox('"+ str +"',vbYesNo, '自定的confirm')=vbYes)", "vbscript");
return(n);
}
alert(confirm("重载的confirm弹出框"));
</script>