views:

10

answers:

0

I am using the LiveValidation plugin http://livevalidation.com/ to validate some input fields on my page. I want to be able to call a function when the validation fails to disable the save button. I have read through the terrible documentation on this plugin and I can not find how to do this.

My example code looks like this

 //create the instance
 var first_name = new LiveValidation('input_first_name', {onlyOnBlur:true, ValidMessage: ' ' } );
 first_name.add(Validate.Presence);

This will check to make sure that the input field is not empty. I would like to do something like this

 //create the instance
 var first_name = new LiveValidation('input_first_name', {onlyOnBlur:true, ValidMessage: ' ' } );
 first_name.add(Validate.Presence, { failure: function() { $('#submit').attr('disable', 'disable') });

But obviously that syntax is not valid and I can not find anything pertaining to this. Anyone know how to do something like this or maybe if you know another validation plugin that can do this and give me an example how it works that would be great. Thanks