Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. $(".form-verify").on("submit", function(e) {
  2. let countErr = 0;
  3. e.preventDefault()
  4. $(this).find('.verify').each(function(){
  5.  
  6. if( $(this).hasClass("check") && this.checked == false ){
  7. $(this).parent('.checkbox-label').addClass('empty')
  8. countErr++;
  9. } else {
  10. $(this).parent('.checkbox-label').removeClass('empty')
  11. }
  12.  
  13. if( $(this).val() == "" ){
  14. $(this).addClass('empty')
  15. countErr++;
  16. } else {
  17. $(this).removeClass('empty')
  18. }
  19. })
  20.  
  21. if (countErr <= 0) {
  22. //AJAX
  23. }
  24.  
  25. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement