PDA

View Full Version : Cancel button on javascript prompt



anwar_khan
10-30-2014, 12:54 PM
Hi All;
i am using the JavaScript prompt to get user input with default value when this prompt comes with a default value in the input box now at this point if the user say cancel the process does not cancel the process the value always comes true in if condition because of default value can we do something that even if the input box has a value and if user click cancel the process should be cancel ???

jscheuer1
10-30-2014, 10:19 PM
Show us your code. But first check here:

http://www.w3schools.com/jsref/met_win_prompt.asp

And make sure you are using it properly. Notice the if test which is used to determine whether or not the user has canceled.