用 UI 对话框替换提示 [英] replace prompt with UI dialog

查看:53
本文介绍了用 UI 对话框替换提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用简单的 UI 对话框替换此代码中的提示以实现相同的目的.IE 使用提示时提示安全问题.

How can I replace the prompt in this code with a simple UI dialog to achieve the same thing. IE is warning about security when using prompt.

HTML:

<input type="text" id="txt1" name="textbox1">
<input type="button" id="btn" name="buttonExecute" value="Enter number">

JavaScript:

JavaScript:

$('#btn').click(function() {
    var n = prompt('Please enter number');
    if ( n!=null && n!="" ) {

    var fixed=n.substr(1,9);

     $('#txt1').val(fixed);
    }
});

推荐答案

使用 jQuery UI.

Use jQuery UI.

在此处查看一个简单的演示.http://jsfiddle.net/5yhmb/23/

See a simple demo here. http://jsfiddle.net/5yhmb/23/

这篇关于用 UI 对话框替换提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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