I have a confirm box and redirect to an action but it is not working..
<script type="text/javascript">
function quitProgram()
{
var answer = confirm("Are you sure you want to quit your current program?");
if (answer)
window.location("http://www.google.com");
else
window.location("http://www.yahoo.com");
}
</script>
Html Code -
<input style="float:right;" type="submit" value="Quit Program" id="QuitProgram" onclick="quitProgram()" />
But the redirect never happens...can anyone help me with this..ultimately what i want to do is redirect to an action based on user response...it would be great if anyone lets me know the best way i should do this?