How to: uncheck/check lots of checkboxes at once
Moderator: General Moderators
Something is really wrong here..
The JavaScript console of FireFox keeps telling me that my functions aren't defined.
Here's the code:
I tried everything I know.
Please, if you can, help me. It's really getting me <span style='color:blue' title='I'm naughty, are you naughty?'>smurf</span>.
Here's the code:
Code: Select all
<script type="text/javascript">
function addFields(monthName) {
document.forms.container.action.value = "addfields";
document.forms.container.month.value = EVAL(monthName);
/*document.forms.container.submit();*/
}
function applyChanges() {
document.forms.container.action.value = "apply";
document.forms.container.submit();
}
function invertCheck(NAME)
{
var inps = document.getElementsByTagName('input');
for (var x in inps)
{
if (document.elements.'+monthname+'[i].checked==true)
{
if (inps[x].type == 'checkbox' && inps[x].name == NAME) inps[x].checked = false;
}
else if (document.elements.'+monthname+'[i].checked==false)
{
if (inps[x].type == 'checkbox' && inps[x].name == NAME) inps[x].checked = true;
}
}
}
</script>Please, if you can, help me. It's really getting me <span style='color:blue' title='I'm naughty, are you naughty?'>smurf</span>.