The full_phone
is gonna do the trick.
It will append a hidden field with full number when submitting the form.
var input = document.querySelector("#phone");
window.intlTelInput(input, {
hiddenInput: "full_phone",
utilsScript: "../../build/js/utils.js"
});
updated:
if the above trick didn't work then don't worry you can fix it by putting a hidden input field before the phone input field.
HTML:
var input = document.querySelector("#phone"),
hidden= document.querySelector("#hidden");
var iti = window.intlTelInput(input, {
nationalMode: true,
utilsScript: "../../build/js/utils.js"
});
var handleChange = function() {
hidden.value = iti.getNumber()
};
// listen to "keyup", but also "change" to update when the user selects a country
input.addEventListener('change', handleChange);
input.addEventListener('keyup', handleChange)