1 2(function ($) { 3 "use strict"; 4 5 6 /*================================================================== 7 [ Validate ]*/ 8 var input = $('.validate-input .input100'); 9 10 $('.validate-form').on('submit',function(){ 11 var check = true; 12 13 for(var i=0; i<input.length; i++) { 14 if(validate(input[i]) == false){ 15 showValidate(input[i]); 16 check=false; 17 } 18 } 19 20 return check; 21 }); 22 23 24 $('.validate-form .input100').each(function(){ 25 $(this).focus(function(){ 26 hideValidate(this); 27 }); 28 }); 29 30 function validate (input) { 31 if($(input).attr('type') == 'email' || $(input).attr('name') == 'email') { 32 if($(input).val().trim().match(/^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{1,5}|[0-9]{1,3})(\]?)$/) == null) { 33 return false; 34 } 35 } 36 else { 37 if($(input).val().trim() == ''){ 38 return false; 39 } 40 } 41 } 42 43 function showValidate(input) { 44 var thisAlert = $(input).parent(); 45 46 $(thisAlert).addClass('alert-validate'); 47 } 48 49 function hideValidate(input) { 50 var thisAlert = $(input).parent(); 51 52 $(thisAlert).removeClass('alert-validate'); 53 } 54 55 56 57})(jQuery);
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.