Replace prompt with UI dialog

How can I replace the prompt in this code with a simple dialog to achieve the same. IE warns about security when using a request.

HTML:

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

JavaScript:

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

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

     $('#txt1').val(fixed);
    }
});
+5
source share
2 answers

Use jQuery user interface.

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

+8
source

Look at the jQuery UI dialog box widget: http://jqueryui.com/demos/dialog/

0
source

All Articles