Q:

add to .each on the next function

I have the next function 
$(".formact").validate({
submitHandler:  function (form) {
$.ajax({
    type: "POST",
    url: "act_cant.php",
    data: $(".formact").serialize(),

    beforeSend: function() {                                
        $("#shopingcountcont").html("<img src='../loading_core/loading animated/loader.gif'class='clock' border='0' />");                                       
    }, 

    success: function(result) {                     
        $("#shopingcountcont").html(result); 

    }

}); 
}
}); 

but in my page i have a multiples form on a same class, they forms are inside in a bucle while.
the problem is that just a  one form run a function but the rest is not, i have taht a .each in the function, but i dont know how to do it.

A:

try
 $(".formact").each(function(){

    $(this).validate({
    submitHandler:  function (form) {
    $.ajax({
        type: "POST",
        url: "act_cant.php",
        data: $(this).serialize(),

        beforeSend: function() {                                
            $("#shopingcountcont").html("<img src='../loading_core/loading animated/loader.gif'class='clock' border='0' />");                                       
        }, 

        success: function(result) {                     
            $("#shopingcountcont").html(result); 

        }

    }); 
    }
    }); 
});

