Sometimes, we need to create a HTML submit form. We need to make sure the conformation before users submit the form. So that, we can use Form onsubmit Event and Inline JavaScript to make it. The onsubmit event occurs when the submit button in a form is clicked.
Single Confirm When Submit
<form name="FORM_NAME" method="post" action="TARGET.php" onsubmit="return confirm('Are you sure?');"> <input type='submit' value='Submit'> </form>
Double Confirm When Submit
<form name="FORM_NAME" method="post" action="TARGET.php" onsubmit="return confirm('Are you sure?') && confirm('Are you really sure?');"> <input type='submit' value='Submit'> </form>
With this method, we able confirm when submit HTML form using Inline JavaScript.
Please do hesitate to contact me if you found out any mistake.