How to implement validation emeil?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
14 views
There are several similar forms with preverco void, still need to check for email via pattern, where it to put ?


$(document).ready(function() { function isFormValid($form) { var is_correct = true; $form.find('.js-valid').each(function(){ if( $(this).val() ==" ) { $(this).addClass('errorInput'); $(this).parent().addClass('error'); is_correct = false; } }); return is_correct; }; function checkValid($form) { var iscorCheck = false; $form.find('.js-check').each(function(){ if( $(this).is(':checked')) { iscorCheck = true; }; }); return iscorCheck; }; $(".js-form-template").submit(function(e) { e.preventDefault(); $('form .js-valid').on('keyup', function(e) { var valid = true; var $proc_form = $(this).parents('form'); if(isFormValid($proc_form)) { $(this).parent().removeClass('error'); } if( $(this).val() !=" ) { $(this).removeClass('errorInput'); }; }); //Form validation var $proc_form = $(this); if(isFormValid($proc_form) && checkValid($proc_form)) { showLoad(); $.ajax({ type: "GET", url: "mail.php", data: $(this).serialize() }).done(function() { $.fancybox.close({ src: '.js-pop' }); hideLoad(); $(this).find("input").val("); $.fancybox.open({ src: '#oky' }); $(".js-form-template").trigger("reset"); }); } return false; }); });
by | 14 views

2 Answers

0 like 0 dislike
To shove you need to function isFormValid, immediately after the check "void". Can use classical regular expressions for eMail, for example, is:
^([a-z0-9]|_){1}((\\-|\\.|_*)?[a-z0-9]+)*@[a-z0-9]{1}((\\-|\\.)?[a-z0-9]+)*\\.[a-z]{2,}$
by
0 like 0 dislike
5ae742e84294a664980119.png
After this curly brace
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
2 answers
asked May 20, 2019 by matthewstafford
0 like 0 dislike
3 answers
asked Apr 5, 2019 by Yubi
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
110,608 questions
257,187 answers
0 comments
40,796 users