Advertisement
Guest User

Untitled

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