Hello. When we use Javascript promt Box something like this
var ur_name = prompt("Enter Name");
We will have two types of values in this case:
- Value entered by user.
- Second VALUE can be NULL, when user press CANCEL or When he presses ESCAPE Key. Right...!!!
Now The problem i m facing is: HOW to Handle escape key in Impromptu plugin of Jquery link text
Code running prefectly When user will Enter Some value OR Press Cancel button
<script type='text/javascript'>
function test()
{
var txt = 'Please enter your name:<br /> <input type="text" id="alertName" name="alertName" value="name here" />';
$.prompt(txt,{
callback: mycallbackform,
buttons: { OK: 'Hello', Cancel: 'Good Bye' }
});
}
function mycallbackform(v,m,f){
if(v=="Hello")
$.prompt("Stack Over flow User:"+' ' + f.alertName);
}
</script>
Cause in this scenario im getting cancel or OK button key pressed events, But when user press ESCAPE key mycallbackform Will not be called...