I was under the impression that this was formed correctly, but here it is forwarding to the anchor href (clicking through? what should I call this?) whether or not the user selects cancel or okay.
<script type="text/javascript">
function myconfirm(my_string)
{
var agree = confirm('Are you sure you want to remove ' + my_string + '?');
if(agree)
{
return true;
}
else
{
return false;
}
}
</script>
and the anchor
<a href="example.com/?remove=yes" onclick="myconfirm('my_string')">My String</a>
You’re not returning anything from the onclick handler. Do
Also, you can shorten that if clause to just
Or even just