Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(formElement).validate({
- errorPlacement: function(error, element) {
- var errorMessage = $(error).html();
- if (errorMessage.length > 0) {
- $(_this).trigger('fieldValidationFailed',{field:element[0], errorMessage:errorMessage})
- }
- },
- success: function(label){
- var fieldName = $(label).attr('for');
- // find the first element that matched the fieldname either by ID or by name (regular fields will be found by ID, radioButtons will be found by name)
- var element = $(formElement).find('[name="' + fieldName + '"]').get(0);
- if (! element) {
- element = $(formElement).find('#' + fieldName).get(0);
- }
- $(_this).trigger('fieldValidationSucceeded',{field: element});
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment