Help with onclick event on Macintosh

S

Spidah

Hi folks

Can somebody help with a problem I am having with onclick events.

If I set up a link link this:

<a href="#" onclick="if(confirm('Do you wish to
proceed?')){location.href='continue.html';}">continue</a>

The onclick works fine on my windows machine, but if the link is clicked on
a macintosh nothing happens after the message box that appears is clicked..
The message box closes and the script goes no further.

Does anyone know how to make this work on both machines? I don't want to
have to switch to using forms and buttons.

Thanks

Hamilton
 
M

Martin Honnen

Spidah said:
Can somebody help with a problem I am having with onclick events.

If I set up a link link this:

<a href="#" onclick="if(confirm('Do you wish to
proceed?')){location.href='continue.html';}">continue</a>

The onclick works fine on my windows machine, but if the link is clicked on
a macintosh nothing happens after the message box that appears is clicked..
The message box closes and the script goes no further.

Does anyone know how to make this work on both machines? I don't want to
have to switch to using forms and buttons.

Try
<a href="continue.html"
onclick="return confirm('Do you wish to continue?');">
though I have no Mac here now to test
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top