D
Donius
Hey everyone, i am doing some stuff where i'd like to pop up a little
confirmation before a user clicks on a 'delete' link. Just trying to
keep the markup clean, i added an attribute pre_act="confirm" to all
of the links that i wanted to do this to and am trying to add an
onclick event that will cancel the click action if they fail. I've got
a test page at http://randomwebspace.net/testing/testpage.html. It has
no unintentional XHTML validation errors, and i am sure that i'm
finding the right elements ((i'm also turning their backgrounds red,
just to be sure))...but the event doesn't get attached. Does anyone
see what my issue is?
Basically the markup that i want to affect looks like:
<a class="iconlink" href="http://www.google.com"
pre_act="confirm">delete</a>
And the code that i'm trying ((for this iteration)) to add an onclick
event is:
function fnConfirm(){ return false; return(confirm('Are you sure?')); }
hecConfirmable.onClick = fnConfirm; /*
HtmlElementCollection...called from a loop */
I'm running the loops that call that code once the body has loaded so i
don't think it's an issue of the DOM not being available yet.
Any ideas? Thanks!
-Brendan
confirmation before a user clicks on a 'delete' link. Just trying to
keep the markup clean, i added an attribute pre_act="confirm" to all
of the links that i wanted to do this to and am trying to add an
onclick event that will cancel the click action if they fail. I've got
a test page at http://randomwebspace.net/testing/testpage.html. It has
no unintentional XHTML validation errors, and i am sure that i'm
finding the right elements ((i'm also turning their backgrounds red,
just to be sure))...but the event doesn't get attached. Does anyone
see what my issue is?
Basically the markup that i want to affect looks like:
<a class="iconlink" href="http://www.google.com"
pre_act="confirm">delete</a>
And the code that i'm trying ((for this iteration)) to add an onclick
event is:
function fnConfirm(){ return false; return(confirm('Are you sure?')); }
hecConfirmable.onClick = fnConfirm; /*
HtmlElementCollection...called from a loop */
I'm running the loops that call that code once the body has loaded so i
don't think it's an issue of the DOM not being available yet.
Any ideas? Thanks!
-Brendan