mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-24 22:11:01 -06:00
Merge pull request #384 from openclassify/vedat
create phoneValidation function
This commit is contained in:
commit
32ced95cf8
@ -33,3 +33,20 @@ function phoneMask(fields) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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