$(document).ready(function() {
    $("#frm_puerta").validate({
        rules: {
            cmb_bodega: {
                required: true
            },
            txt_codigo: {
                required: true
            },
            txt_descripcion: {
                required: true
            },
            txt_capacidad_max: {
                required: true,
                number: true,
                digits: true,
                min: 1
            },
            cmb_prioridad: {
                required: true
            }
        },
        submitHandler: function(form) {

            guardarPuerta();

        },
        highlight: function(element) {
            $(element).closest('div').addClass('has-error');
        },
        unhighlight: function(element) {
            $(element).closest('div').removeClass('has-error');
        },
        errorElement: 'span',
        errorClass: 'help-block'
    });

});


