in javascript im calling a bunch of the scripts
Code: Select all
function chkAll(){
script1();
script2();
script3();
other1();
other2();
}
As is i have it as the first one but it would make sense to put it as the second 1 so its not id specific (this is checking if a checkbox is checked and it will activate a hidden input).
Code: Select all
<input type="checkbox" id="check1" name="check1" value="1" <?php if ($x == 1){echo "checked='checked'";}?> onclick="script1()" />
<input type="hidden" id="hide1" name="check1" value="" disabled="disabled" />
Code: Select all
function current(){
if (document.getElementById('check1').checked){document.getElementById('hide1').disabled=true;}
else{document.getElementById('hide1').disabled=false;}
}
function correct(a,b){
if (document.getElementById(a).checked){document.getElementById(b).disabled=true;}
else{document.getElementById(b).disabled=false;}
}
Code: Select all
function correct(a,b){
if (document.getElementById(a).checked){document.getElementById(b).disabled=true;}
else{document.getElementById(b).disabled=false;}
}
function chkAll(a,b){
correct(a,b);
other1();
other2();
}/*doesnt work*/
function chkAll(){
correct(a,b);
other1();
other2();
}/*doesnt work*/