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);
}
});
Ntguy source
share