We can attach a function on to the onsubmit event of the form, which is triggered by the submit button.
script.js
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.
The original poster says nothing about a redirect link. I think that might be a misunderstanding that is occurrring.