PageSourceSearch

https://kuzmenov.ru/wp-content/plugins/jquery-validation-for-conta…/assets/js/jvcf7_validation.js?ver=5.1

js kuzmenov.ru collected 2026-10-08 14:51:43 UTC 1,649 bytes, 42 lines download raw bytes

1// VALIDATION CODES
2jQuery(document).ready(function(){
3	
4	jQuery('.wpcf7-validates-as-required').addClass('required');
5	jQuery('.wpcf7-email').addClass('email');
6	jQuery('.wpcf7-checkbox.wpcf7-validates-as-required input').addClass('required');
7	jQuery('.wpcf7-radio input').addClass('required');
8	
9	jQuery('form.wpcf7-form').each(function(){
10		jQuery(this).addClass(scriptData.jvcf7_default_settings.jvcf7_invalid_field_design);
11		jQuery(this).addClass(scriptData.jvcf7_default_settings.jvcf7_show_label_error);
12		jQuery(this).validate({
13			errorPlacement: function(error, element) {
14	            if (element.is(':checkbox') || element.is(':radio')){
15	            	error.insertAfter(jQuery(element).parent().parent().parent());
16	            } else {
17	            	error.insertAfter(element);
18	            }
19         	}
20		});
21	});
22
23	jQuery('.wpcf7-form-control.wpcf7-submit').click(function(e){ 
24		$jvcfpValidation 	=	jQuery(this).parents('form');		
25		if (!jQuery($jvcfpValidation).valid()){
26			e.preventDefault();
27			$topErrorPosition 		= jQuery('.wpcf7-form-control.error').offset().top;
28			$topErrorPosition		= parseInt($topErrorPosition) - 100;
29			jQuery('body, html').animate({scrollTop:$topErrorPosition}, 'normal');
30		}
31	});	
32});
33
34jQuery.validator.addMethod("email", 
35    function(value, element) {
36        return this.optional(element) || /^[+\w-\.]+@([\w-]+\.)+[\w-]{2,10}$/i.test(value);
37    },"Please enter a valid email address"
38);
39
40jQuery.validator.addMethod("letters_space", function(value, element) {
41  return this.optional(element) || /^[a-zA-Z ]*$/.test(value);
42}, "Letters and space only");

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.