I need to make sure that 1 field os less than the other so I am using
the dependency callback feature and it's working but I cannot get an
error message to display - anyone get this to work?

Here is my code:
$(document).ready(function(){
    $("#AddPartner").validate({
        rules: {
        GlobalDiscount: {
          required: function(element) {
            if ($("#GlobalDiscount").val() <= 20) { alert('passed');
return true } else { alert('falied'); return false }
            if ($("#GlobalDiscount").val() <= $
("#ComissionSplit").val()) { alert('passed'); return true } else
{ alert('falied'); return false }
          }
        },
        ComissionSplit: {
          required: function(element) {
             if ($("#ComissionSplit").val() <= 20) { alert('passed');
return true } else { alert('falied'); return false }
          }
        }
      },
      messages: {
        ComissionSplit: { dependency: "Comission plit must be less
than 20"   },
        GlobalDiscount: { dependency: "Global Discount must be less
than your Comission Split"    }
      }
    });
});

Reply via email to