mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
Merge pull request #384 from openclassify/vedat
create phoneValidation function
This commit is contained in:
commit
32ced95cf8
@ -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();
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user