Hi,

I have some jquery code within the

$(document).ready(function() {
   $("input:checkbox").click(function(){
        .... check if checked or unchecked....

        ... do some ajax stuff .....

        .... do some css class exchange stuff ......
   });
});
(This is the function to manipulate my code on a single checkbox
event)

The ajax part and the css class stuff I want now to "surround" as
function in order to use it in another function:

$(document).ready(function() {
        $("#paradigm_all").click(function(){
        var checked_status = this.checked;
        $("input[name^='paradigm']").each(function(){
                this.checked = checked_status;
                if(checked status == true){
                   _call_my_ajax_function();
                   _call_my_css_class_function
                }
        });
    });
});
(This is the function to manipulate my code when the checkbox "check
all / uncheck all" was checked or unchecked)

To be honest I am a little bit lost in the syntax and not sure how to
structure it well in order to be able re-using the functions.
Would be great if someone could give me a hand with it!
Thanks!

Reply via email to