|
Hi
I have a list of members and each member has a delete button next to them which calls a function and sets a confirm window/layer to visible when clicked. On the confirm window/layer I have two buttons Yes and No. No sets the confirm window/layer to hidden.
I'm having trouble with the Yes button because I need to set the onClick value of the Yes button so that it will contain a url with the unique details so that the php page knows who to delete.
Here's some of the code I've been playing around with...
The delete button next to each member:
<img src="images/os/programs/declaration/del-player-out.gif" onclick="deleteMemberConfirm('', '', '', 'Delete Member', 'Are you sure you want to delete ....?')");
The function the delete button calls:
function deleteMemberConfirm(fuid, fgid, fpid, ftitle, fmessage) {
document.getElementById("confirmTitle").innerHTML = ftitle;
document.getElementById("confirmMessage").innerHTM L = fmessage;
document.getElementById("confirmWindow").style.vis ibility = 'visible';
document.getElementById("confirmYes").SetAttribute ("onClick", "removemember.php?gid=" + fgid + "&pid=" + fpid + "&uid=" + fuid);
}
The button I want to change the onClick value:
<input name="confirmYes" type="button" id="confirmYes" value="Yes" onClick="">
The only thing that isn't working in the function is the document.getElementById("confirmYes").SetAttribute .... line. I've tried different ways but whenever I look at the source code the value is blank.
I also know that I'm not passing any of the unique details through to the function yet so the url will not be complete. I'm really just trying to get the onClick value to change to anything before I pass those through.
Any help will be appreciated as I'm not finding much on google.
I can do it via php and set the onclick value by refreshing the page before the confirm window is shown but I'm trying to cut down pointless loads like that.
Thanks
Kevin
|