I have a form that submits information to a database. How can I make it so that when I click the submit button, I get an alert that asks me if I really want to submit it and when I click “Yes” it continues and if I click “no” it does not submit the information.
Share
Use JavaScript
confirm()function.If the user chooses Yes, it will return
trueand the button’s default action (submitting the form) will continue as usual. But if the user chooses No, it will returnfalseand the button’s default action will be blocked.