How to: uncheck/check lots of checkboxes at once

JavaScript and client side scripting.

Moderator: General Moderators

User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

Regarding JS an Firefox: have a look at the Venkman extension: https://addons.mozilla.org/extensions/m ... php?id=216
pilau
Forum Regular
Posts: 594
Joined: Sat Jul 09, 2005 10:22 am
Location: Israel

Post by pilau »

Thanks d11wtq, that's exactly what I needed!
pilau
Forum Regular
Posts: 594
Joined: Sat Jul 09, 2005 10:22 am
Location: Israel

Something is really wrong here..

Post by pilau »

The JavaScript console of FireFox keeps telling me that my functions aren't defined.
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>
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>.
Post Reply