PDA

View Full Version : Confirm on link selection


florida
05-10-2004, 08:35 PM
I want to have a link where you click on it and it will give you information about it and then you can choose to either continue (go to the web page) or cancel and stay in the same page.

Please advise how I can do this. Here is my attempt but not working:


function myfunc()
{
var yes = confirm("My page info. Would you like to view this page?\n");
if(yes)
{
return true;
}
else
{
location.href="stayoncurrentpage.cfm";
return false;
}
}

</script>




<a href="mylink.cfm" onclick="myfunc();"><strong>mylink</strong></a>

Vladdy
05-10-2004, 08:52 PM
<a href="mylink.cfm" onclick="return myfunc();"><strong>mylink</strong></a>

function myfunc()
{ return confirm("My page info. Would you like to view this page?\n");
}

Willy Duitt
05-10-2004, 09:08 PM
oaklander / florida

I have also answered your question here (http://www.webxpertz.net/forums/showthread.php?t=28803). :rolleyes:

florida
05-12-2004, 11:41 AM
Thanks!