I have 3 buttons on the button of the page. They ar e submit, Exit without Save and Reset button. On the Exit Without Save button, I have onclick="ExitWithOutSave()". If the user click on Exit without Save button, I want to alert the user, if he click yes, then I want to redirect him to another page, if no, then I want to stay on the same page that he is on. I am having problem on the response.redirect line. Here is my code:
<script language="vbscript" >
Sub ExitWithOutSave()
Answer=MsgBox ("You have selected to exit this page without saving the record . Are you sure you want to exit now?",52,"Exit Without Save"
If Answer=6 then 'click Yes
response.redirect("default.asp"
else
history.go(-1) 'return to previous page
end if
End Sub
</script>
Please help. Thanks in advance.
<script language="vbscript" >
Sub ExitWithOutSave()
Answer=MsgBox ("You have selected to exit this page without saving the record . Are you sure you want to exit now?",52,"Exit Without Save"
If Answer=6 then 'click Yes
response.redirect("default.asp"
else
history.go(-1) 'return to previous page
end if
End Sub
</script>
Please help. Thanks in advance.