Give your form and button an id
, set the button as type button
, it should work on every (ancient) browser:
Javascript:
<script type="text/javascript">
function alertMsg() {
if (confirm("Are you sure you want to submit the form?")) {
//Try to submit the form
document.getElementById('form1').submit();
}
}
</script>
HTML
<form name="form1" id="form1" action="">
<input type="button" onclick="alertMsg()" value="Save" name="action_saveandcontinue" class="button" id="action_saveandcontinue"/>
</form>
EDIT: If you have no control over the HTML code, better read this SO question, this SO question and this MSDN documentation.