Merge pull request #384 from openclassify/vedat

create phoneValidation function
This commit is contained in:
Fatih Alp 2020-03-03 18:42:23 +03:00 committed by GitHub
commit 32ced95cf8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,4 +32,21 @@ function phoneMask(fields) {
clearIncomplete: true
});
}
}
function controlNumber(inputQuery) {
var iti = intlTelInput(inputQuery, {
hiddenInput: inputQuery.getAttribute('name'),
class: "form-control",
initialCountry: "auto",
geoIpLookup: function (success, failure) {
$.get("https://ipinfo.io", function () {
}, "jsonp").always(function (resp) {
var countryCode = (resp && resp.country) ? resp.country : "";
success(countryCode);
})
}
})
return iti.isValidNumber();
}