A confirmation dialog box is mostly used to take user’s consent on any option. It displays a dialog box with two buttons: Cancel. If the user clicks on the OK button, the window method confirm() will return true. If the user clicks on the Cancel button, then confirm() returns false. You can use a confirmation dialog box as follows.
- VAR: means VARIABLE. A temporary storage place.
- ANSWER: is the name of that storage place. Depending on the visitor’s response, the ANSWER will hold either a TRUE or FALSE value.
- CONFIRM: creates the actual pop-up box with an OK and CANCEL choice. OK is used for a TRUE response. CANCEL is used for a FALSE response. The text area following is used as the prompt text on the box. Usually a true/false type question.
- IF() ELSE: This determines what happens according to the input. It looks at the storage cell called ANSWER. IF it is a TRUE value, it does the first set of instructions. ELSE it is a FALSE value, so do this other set of instructions.
To get the CONFIRM actions to perform, we have to use a VARIABLE situation to control it. That means, we have to use a bit of algebra to temporarilly assign a value to the visitor’s answer choice. After the value (answer) is determined, the script then carries out the set of instructions accordingly. This is usually done with an IF…ELSE statement. IF the answer is true, do this. ELSE the answer is false, so do this instead.
2.) No JQuery File.
3.) No HTML-CSS Added.
4.) Simple And Fast Loading Code.
5.) Can Work With Any Browser.
How To Add In A WebPage?
1.) Just Go To Your “Web Page File”.
2.) Now “Copy” The Below Codes And “Paste” It To There Positions.
3.) “Save” It, Now You Are Done.
That’s all we have. If you have any problem with this code in your template then feel free to contact us with full explanation of your problem. We will reply you as time allow to us. Don’t forget to share this with your friends so they can also take benefit from it and leave your precious feedback in our comment form below. Happy blogging, See you in next article…