views:

36

answers:

1
    $(".normalform").click( function() { 

        var hrf = $(this).attr("href");
        var typ = $(this).attr("frm_type");
        var cls = $(this).attr("class");
        var nam = $(this).attr("frm_nam");
        var url = $(this).attr("url");

        //alert("href:"+hrf+", "+"type:"+typ+", "+"class:"+cls+", "+"name:"+nam+", "+"url:"+url+", "); 

        $("#contentContainer").load(url, null, function() { 

            //start validate : normalform
            jQuery("#normalform").validate({
                submitHandler: function(form) {
                    $('#submitbutton').attr('disabled', 'disabled');
                    jQuery("#normalform").ajaxSubmit({
                        target: "#result",
                        error: function () {
                            $('#submitbutton').removeAttr('disabled');
                            alert('Submission Error ! Try again.');                             
                        }, 
                        success: function (data) { 
                            $('#submitbutton').removeAttr('disabled');
                        },
                        clearForm: true
                    });
                }
            });
            //end   validate : normalform

        });

    });

Additional info:

.normalform : is the link that loads the form into contentContainer
#normalform : is the formloaded, that wldnt respond to validation function.

A: 

.normalform : is the link that loads the form into contentContainer,

normalform : is the formloaded, that wldnt respond to validation function.

Alex