equal
deleted
inserted
replaced
81 }, |
81 }, |
82 validateForm: function( selector ) { |
82 validateForm: function( selector ) { |
83 selector = jQuery( selector ); |
83 selector = jQuery( selector ); |
84 return !wpAjax.invalidateForm( selector.find('.form-required').filter( function() { return jQuery('input:visible', this).val() === ''; } ) ).length; |
84 return !wpAjax.invalidateForm( selector.find('.form-required').filter( function() { return jQuery('input:visible', this).val() === ''; } ) ).length; |
85 } |
85 } |
86 }, wpAjax || { noPerm: 'Sorry, you are not allowed to do that.', broken: 'Something went wrong.' } ); |
86 }, wpAjax || { noPerm: 'Sorry, you are not allowed to do that.', broken: 'An error occurred while processing your request. Please refresh the page and try again.' } ); |
87 |
87 |
88 // Basic form validation. |
88 // Basic form validation. |
89 jQuery( function($){ |
89 jQuery( function($){ |
90 $('form.validate').on( 'submit', function() { return wpAjax.validateForm( $(this) ); } ); |
90 $('form.validate').on( 'submit', function() { return wpAjax.validateForm( $(this) ); } ); |
91 }); |
91 }); |