alex91ckua

Untitled

May 10th, 2020
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. function wpisValidateIntPhone(telInput){
  2.  
  3. var errorMsg = telInput.parent().parent().find(".error-msg"),
  4. validMsg = telInput.parent().parent().find(".valid-msg");
  5.  
  6. wpisHideValidationErrors(telInput);
  7.  
  8. if ($j.trim(telInput.val())) {
  9. if (telInput.intlTelInput("isValidNumber")) {
  10. validMsg.removeClass("hide");
  11. var nationalPhone = telInput.intlTelInput("getNumber");
  12. telInput.val(nationalPhone);
  13. // ->>>>> here you can add your code to ENABLE form submit button
  14. } else {
  15. telInput.addClass("error");
  16. errorMsg.removeClass("hide");
  17. validMsg.addClass("hide");
  18. // ->>>>> here you can add your code to DISABLE form submit button
  19. }
  20. }
  21. }
Add Comment
Please, Sign In to add comment