send number with country code in form

master
Gustavo Luigi 2022-09-08 13:31:11 +02:00
parent 1ad1ed3174
commit ffc413d1c8
1 changed files with 3 additions and 3 deletions

View File

@ -12,8 +12,9 @@ function getAddressFiedlValue(addressComponents, $field){
}

let input = document.querySelector("#ctelefon");
let iti = null;
if(input != undefined){
let iti = window.intlTelInput(input, {
iti = window.intlTelInput(input, {
initialCountry: "de",
preferredCountries: ["de"],
geoIpLookup: function(callback) {
@ -65,8 +66,6 @@ function updateProducts(){
}
}

// iti.getNumber();

$(window).on('load', function(){
updateProducts();
$("#successful-submitting-form").delay(4000).slideUp(200, function() { $(this).alert('close'); });
@ -81,6 +80,7 @@ $(window).on('load', function(){
});
let cart = products.join(" - ")+" - Gesammt: "+numberToEuroFormat(totalPrice);
$('#ccart').val(cart);
$('#ctelefon').val(iti.getNumber());
objProducts = [];
localStorage.setItem("products", JSON.stringify(objProducts));
form.unbind('submit').submit();