We can attach a function on to the onsubmit event of the form, which is triggered by the submit button.

script.js

`javascript

var form = document.getElementById('registerUser');form.onsubmit = function () { // this method is cancelled if window.confirm returns false return window.confirm('Are you sure that you want to submit this form?');}

If the OK button is pressed, that will result in a true value from the confirm dialog. The onsubmit event is only cancelled when false is returned, so with true being returned the form will submit as per normal.

mixo said:

what wheres the redirect link?

The original poster says nothing about a redirect link. I think that might be a misunderstanding that is occurrring.