redirect on confirm

  • Thread starter Thread starter Jon Paal
  • Start date Start date
J

Jon Paal

I can't seem to get this to redirect on confirm.
Dialog appears but does not change pages on "ok" what's missing here ?

btnComplete.Attributes.Add("onclick", "if(confirm(' complete ?')){window.location = 'thankyou.aspx'}else{return false}")
 
What happens if you simply use this. ?

window.location = 'thankyou.aspx'
I can't seem to get this to redirect on confirm.
Dialog appears but does not change pages on "ok" what's missing here ?

btnComplete.Attributes.Add("onclick", "if(confirm(' complete ?')){window.location = 'thankyou.aspx'}else{return false}")
 
Hi,

Jon said:
I can't seem to get this to redirect on confirm.
Dialog appears but does not change pages on "ok" what's missing here ?

btnComplete.Attributes.Add("onclick", "if(confirm(' complete
?')){window.location = 'thankyou.aspx'}else{return false}")

The code above looks OK to me.

To check what the error is:

- Check the produced HTML / JavaScript code. What does it look like?
- Execute your code in Firefox, then click on Tools / JavaScript
console. What does it say?

HTH,
Laurent
 
Back
Top