View Full Version : Cancel button on javascript prompt

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 ???

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


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