Here I will show how to show Confirmation Dialog Box Using Javascript?
Here I Have create javascript function such as ConfirmationBox() and that function call On button Click as onclick event then- <script type="text/javascript">
- function ConfirmationBox() {
- var Yes= confirm("User want's to continue..?");
- var check = new Boolean(Yes);
- if (check == true) {
- alert('want to continue Yes');
- return true;
- }
- else {
- alert('user dont continue');
- return false;
- }
- }
- </script>
- <div>
- <input type="button" value="Click Me" onclick="ConfirmationBox();" />
- </div>

And after ok Click then

Or cancel button click on



Nalini NandaPosted Dec 30, 2014, 2:26 AM
I think its need not convert to Boolean value,It should return true or false by default var check = new Boolean(Yes)