Confirm When Submit HTML Form Using Inline JavaScript

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.

Confirm When Submit HTML Form Using Inline JavaScript

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>
Confirm Example:

Double Confirm When Submit HTML Form Using Inline JavaScript

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>
Double Confirm Example:

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.