Click to See Complete Forum and Search --> : window.location.replace not working :(


Spudlington
11-29-2003, 11:23 AM
Hello, I am trying to make a confirmation box on a link, so that you have to click ok before the link will work. However when you click ok, or cancel it does nothing. Am I missing something simple here? Here is my code.

<a href="javascript:;" onClick="temp = window.confirm(' Do you really want to delete this entry?'); if (temp == 1) window.location.replace('deleterosterentry.php');">blah</a>

:confused:

Thankyou

Mr J
11-29-2003, 11:47 AM
Please try the following

<a href="#null" onClick="temp = window.confirm(' Do you really want to delete this entry?'); if (temp == 1) window.location.replace('deleterosterentry.php');">blah</a>

Spudlington
11-29-2003, 11:52 AM
Thankyou so much that works wonderfully.