如何在Javascript中显示是/否选项 [英] How to show Yes/No option in Javascript

查看:76
本文介绍了如何在Javascript中显示是/否选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在使用confirm("Do you want to proceed?").但是这里会出现确定/取消"警报.
但是我需要是/否选项.

Hi,
I am using confirm("Do you want to proceed?"). But here am getting Ok/Cancel alert.
But i need Yes/No option.
How to do that?

推荐答案

此处开始[^ ];这提供了很好的描述:如果要自定义对话框,请检查 jQuery [ AjaxControlToolkit [ ^ ].
Start here[^]; this provides good descriptions: if you want a custom dialog check jQuery[^] or AjaxControlToolkit[^].


对于真正的Javascript标准,这是不可能的.这仅适用于32位Windows,仅适用于IE.在Firefox上,它不会显示是/否提示.

For true Javascript standard it is not possible. This will only work on 32 bit Windows and only on IE. On Firefox it will not show Yes/No prompt.

<script language="javascript">
    function window.confirm(str)
    {
        execScript('n = msgbox("'+str+'","4132")', "vbscript");
        return(n == 6);
    }
    var r = confirm("Can you do it?");
    alert(r);
</script>


一个人可以实现它-使用VBScript使用Yes/No而不是Ok/Cancel.

请找到下面包含所有选项的链接,这些链接将为您提供帮助:
http://www.perlscriptsjavascripts.com/js/alertboxes.html [
One can achieve it - having Yes/No instead of Ok/Cancel using VBScripts.

Please find the link below that has all the options and will help you out:
http://www.perlscriptsjavascripts.com/js/alertboxes.html[^]


这篇关于如何在Javascript中显示是/否选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆