sophielois
Technical User
How can i enable a user to click a link which triggers an alert saying something like
"are you sure you want to do that"
then if the user clicks yes it continues to the url if the user clicks no it stays where it is.
been trying to play around with this
and
I have little JS knowledge so don't really know where to go from here?
plus im pretty sure my mark up is incorrect in the link code
Soph
"are you sure you want to do that"
then if the user clicks yes it continues to the url if the user clicks no it stays where it is.
been trying to play around with this
Code:
function checkCom(url) {
if (confirm("Are you sure you want to do that")) {
document.location = url;
}
}
and
Code:
<? echo"<a href=\"'javascript:checkCom'/55731/can/can_complete.php?userid=$userid\">Mark as Complete</a>";?>
I have little JS knowledge so don't really know where to go from here?
plus im pretty sure my mark up is incorrect in the link code
Soph