Follow along with the video below to see how to install our site as a web app on your home screen.
Примечание: This feature may not be available in some browsers.
function SetAllCheckBoxes(FormName, FieldName, CheckValue)
{
if(!document.forms[FormName])
return;
var objCheckBoxes = document.forms[FormName].elements[FieldName];
if(!objCheckBoxes)
return;
var countCheckBoxes = objCheckBoxes.length;
if(!countCheckBoxes)
objCheckBoxes.checked = CheckValue;
else
// set the check value for all check boxes
for(var i = 0; i < countCheckBoxes; i++)
objCheckBoxes[i].checked = CheckValue;
}
первая ссылка в гугле - js checkbox check allPHP:function SetAllCheckBoxes(FormName, FieldName, CheckValue) { if(!document.forms[FormName]) return; var objCheckBoxes = document.forms[FormName].elements[FieldName]; if(!objCheckBoxes) return; var countCheckBoxes = objCheckBoxes.length; if(!countCheckBoxes) objCheckBoxes.checked = CheckValue; else // set the check value for all check boxes for(var i = 0; i < countCheckBoxes; i++) objCheckBoxes[i].checked = CheckValue; }
function checkAllBoxes(checked)
{
if (!checked)
checked = '+';
for(var FormName in document.forms)
{
for(var j in document.forms[FormName].elements)
if (document.forms[FormName].elements[j].type && document.forms[FormName].elements[j].type == 'checkbox')
{
switch(checked)
{
case '-':
document.forms[FormName].elements[j].checked = false;
break;
case '+':
document.forms[FormName].elements[j].checked = true;
break;
case '*':
document.forms[FormName].elements[j].checked = 1 - document.forms[FormName].elements[j].checked;
break;
}
}
}
}