Hi All, I'm attempting to put several instances of Javascript code on the same page but it isn't working.
How do I add multiple instances of Javascript on one page?
4
Hi All,
I'm attempting to put several instances of Javascript code on the same page but it isn't working.
Here is the code that goes in the header...
...and here is the HTML:
If I try to place the same HTML snippet a second or third time on the page, the function no longer works correctly.
Please help!
Thanks,
Vic
I'm attempting to put several instances of Javascript code on the same page but it isn't working.
Here is the code that goes in the header...
Code:
<script type="text/javascript">
function toggleAccept() {
var acceptLink = document.getElementById("accept");
var agreeCheckbox = document.getElementById("agreeCheckbox");
if (agreeCheckbox.checked) {
acceptLink.onclick=function() {
window.location=this.href + "&cbrblaccpt=true";
return false;
}
} else {
acceptLink.onclick=function() {
mustAccept();
return false;
}
}
}
function mustAccept() {
window.alert("By clicking accept, you agree to the payment terms of this recurring product.");
}
cbrblaccpt
</script> Code:
<p align="center"><form action="#"><input type="checkbox" onchange="toggleAccept()" id="agreeCheckbox">
<label for="agreeCheckbox"><b>I understand that this product is billed on a monthly basis and that I can cancel my subscription at any time.</b></label></form></p>
<p align="center"><a href="http://2-monthly.vicdorfman.pay.clickbank.net/?cbur=a" id="accept" onclick="mustAccept(); return false;"><img alt="" src="images/signup-37.jpg" style="border: 0px solid ; width: 350px; height: 147px;" /></a></p> Please help!
Thanks,
Vic
- dwbiz05
- vtotheyouknow
- kewkii
Next Topics on Trending Feed
-
4