This is the code:
At the moment, it disables checkboxes via a master checkbox.
But what I want it to do is ENABLE the checkboxes via the master checkbox.
Also, the master checkbox has to be a radio, or at least function like a radio.
Any help?
(and yes, I have tried coding forums and sites, I'm desperate to get this sorted out today!)
edit: code tags aren't working
=======================================
// The check box group is definded by the check boxes with a parent of the same title
// A check box with a parent node of the group title suffixed with 'f7_Master'
// is used to set the disable status of the other check boxes
// Example HTML Code for one group
//
//
//
//
//
//
// Master
//
// or to force the disabled group into a checked state of checked use
//
// Master
//
// or to force the disabled group into a checked state of unchecked use
//
// Master
//
// Each group is initialised from a onload event
//
// where
// All variable, function etc. names are prefixed with 'f7_' to minimise conflicts with other javascripts
var f7_cks;
function f7_DisableCBGroup(){
f7_cks=document.getElementsByTagName('INPUT');
for (f7_0=0;f7_0
if (f7_cks[f7_0].type=='checkbox'){
if (f7_cks[f7_0].parentNode.title.match('f7_Master')){
f7_cks[f7_0].parentNode.state=f7_cks[f7_0].parentNode.title.split('f7_Master')[1];
f7_cks[f7_0].parentNode.title=f7_cks[f7_0].parentNode.title.replace(f7_cks[f7_0].parentNode.state,'')
f7_Disable(f7_cks[f7_0])
f7_cks[f7_0].onclick=function(){ f7_Disable(this); }
}
}
}
}
function f7_Disable(f7_obj){
for (f7_1=0;f7_1
if (f7_cks[f7_1].parentNode.title==f7_obj.parentNode.title.replace ('f7_Master','')){
if (f7_obj.checked){
f7_cks[f7_1].setAttribute('disabled',true)
if (f7_obj.parentNode.state=='CHECK'){
f7_cks[f7_1].checked=true;
}
if (f7_obj.parentNode.state=='UNCHECK'){
f7_cks[f7_1].checked=false;
}
}
else {
f7_cks[f7_1].removeAttribute('disabled')
}
}
}
}
//-->
=======================================
At the moment, it disables checkboxes via a master checkbox.
But what I want it to do is ENABLE the checkboxes via the master checkbox.
Also, the master checkbox has to be a radio, or at least function like a radio.
Any help?
(and yes, I have tried coding forums and sites, I'm desperate to get this sorted out today!)
edit: code tags aren't working
=======================================
// The check box group is definded by the check boxes with a parent of the same title
// A check box with a parent node of the group title suffixed with 'f7_Master'
// is used to set the disable status of the other check boxes
// Example HTML Code for one group
//
//
//
//
//
//
// Master
//
// or to force the disabled group into a checked state of checked use
//
// Master
//
// or to force the disabled group into a checked state of unchecked use
//
// Master
//
// Each group is initialised from a onload event
//
// where
// All variable, function etc. names are prefixed with 'f7_' to minimise conflicts with other javascripts
var f7_cks;
function f7_DisableCBGroup(){
f7_cks=document.getElementsByTagName('INPUT');
for (f7_0=0;f7_0
if (f7_cks[f7_0].parentNode.title.match('f7_Master')){
f7_cks[f7_0].parentNode.state=f7_cks[f7_0].parentNode.title.split('f7_Master')[1];
f7_cks[f7_0].parentNode.title=f7_cks[f7_0].parentNode.title.replace(f7_cks[f7_0].parentNode.state,'')
f7_Disable(f7_cks[f7_0])
f7_cks[f7_0].onclick=function(){ f7_Disable(this); }
}
}
}
}
function f7_Disable(f7_obj){
for (f7_1=0;f7_1
if (f7_obj.checked){
f7_cks[f7_1].setAttribute('disabled',true)
if (f7_obj.parentNode.state=='CHECK'){
f7_cks[f7_1].checked=true;
}
if (f7_obj.parentNode.state=='UNCHECK'){
f7_cks[f7_1].checked=false;
}
}
else {
f7_cks[f7_1].removeAttribute('disabled')
}
}
}
}
//-->
=======================================
Comment