Hello Guys!

I've got a script here which I'm looking for your help in bettering.
At the moment the script gives me a 'select all' checkbox which when
checked ticks a bunch of other checkboxes, also I have another
function which enabled/disables an input button provided that 1 or
more of the checkboxes are checked.

            $("input[name=select_all_campaigns]").click(function()
            {
                var checked_status = this.checked;
                $("input[name=Campaign_IDs]").each(function()
                {
                    this.checked = checked_status;
                });
            });
            $("input[name='Campaign_IDs']").click(function() {
                                if 
($("input[name='Campaign_IDs']:checked").length == 0) {
                                        $('input:submit').fadeTo('slow', 0.3);
                                        $('input:submit').attr('disabled', 
true);
                                }
                                else {
                                        $('input:submit').fadeTo('slow', 1.0);
                                        $('input:submit').attr('disabled', 
false);
                                }
            });

Now, I want to add the following functionally to the script.:

1. when all checkboxes are checked invdividualy the select all box is
automaticaly checked.
2. If I click the 'select all' checkbox and then uncheck an individual
checkbox have the select all uncheck itself.
3. When I check the 'select all' box have the submit button fade in
and enable itself as more than one checkbox will then be enabled,
likewise, if unchecking select all to uncheck all boxes, disable the
button again.

Can you guys make some suggestions on this?

Many thanks guys,

Robert

Reply via email to