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:
$('#btn').click(function() {
var n = prompt('Please enter number');
if ( n!=null && n!="" ) {
var fixed=n.substr(1,9);
$('#txt1').val(fixed);
}
});
Use jQuery UI.
See a simple demo here. http://jsfiddle.net/5yhmb/23/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With