I have a problem with the validation plugin when I add a new
validation method in IE8, when I submit the form it just validate the
added method but the other fields are submitted anyway.

Also I have another problem with the  valid() function, when I try to
see if the function is true to show a confirmation message IE8 show
the javascript error:

'settings' is null or not an object Line: 788 Character: 3


There is the way I add the new validation method:

<script type="text/javascript">
  $(document).ready(function(){

 $.validator.addMethod("nonEmptyTable", function(value, element) {

  return get_table_data();

}, 'xxx.');

$("#OrdenForm").validate({
  rules: {
    id_orden:{required:true},
    fecha_sol: {required:true, dateISO: true},
    concepto: {required:true},
    cen_cos: {nonEmptyTable:true},
    val_tot: {required:true, number:true}
  },
  messages:{
        id_orden: {required:"xxx"},
        fecha_sol: {required:"xxx"},
        concepto: {required:"xxx" },
        cen_cos: {nonEmptyTable:"xxx"},
        val_tot: {required: "xxx"}
    }
});

  });
  </script>


There's how I do the submit verification to show the dialog

  <script type="text/javascript">

    $(function(){

        $("#dialog").dialog({
                        bgiframe: true,
                        autoOpen: false,
                        height: 160,
                        width: 330,
                        modal: true,
                        buttons: {
                                'OK': function() {
                                    document.OrdenForm.submit();
                                },
                                'Cancel': function() {
                                        $(this).dialog('close');
                                }
                        }
                });

          $('#OrdenForm').submit(function(){

        if($('#OrdenForm').valid())
          {
             $('#dialog').dialog('open');
             return false;
          }

        });
    });
  </script>


Any help will be very appreciated...

Reply via email to