mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-09 23:06:08 -06:00
create phoneValidation function
This commit is contained in:
parent
de88978e1f
commit
a9688f07e2
@ -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