Creating warning messages in submit forms

While building complex forms and submit inputs for your web page it is useful to allow users to modify data they have previously entered. That will give your visitors an option to update their info or contact details for example, but that can be potential

Changing of data can be easily managed with forms but when user have option to delete some details about them it can be handy to insert special JavaScript "Are you sure?" alert that will inform user that changes he is about to make cannot be undone.

In creating this simple alert button first step is to place following code into <header>

This JavaScript function confirmPost() handle the situation when user is prompted to answer "Yes" or "Cancel".
If "Yes" is clicked script continues and if user choose "Cancel" form processing is stopped.

Of course you can change the "ARE YOU SURE ?" and write any other warning message.

Next step is placing this JavaScript function into work. In your form you have to create special input tag with onClick event: