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


// iti.getNumber();

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