gh电话区号下拉框添加ip判断

master
zhongjinyuanhuaxue 1 year ago
parent 7d23801b2e
commit 6d6576cefc

@ -246,7 +246,7 @@
<!-- <p><input class="InquiryCalendar" data-min-date="7" id="starting_date" name="date_start"
placeholder="Starting date" required type="date"></p> -->
<select class="country_code" name="country_code">
<select class="country_code" name="country_code" id="country_code">
<option style="font-weight: 600;" value="United States +1">United States&nbsp; &nbsp;+1
</option>
<option style="font-weight: 600;" value="United Kingdom +44">United Kingdom&nbsp;
@ -827,4 +827,20 @@
$("#email").mailAutoComplete({
email: ['gmail.com', 'outlook.com', 'yahoo.com', 'icloud.com', 'hotmail.com', 'live.com', 'aol.com']
});
</script>
<script>
$(function () {
$.getJSON("https://www.globalhighlights.com/index.php/location/get_country", function (data) {
var yourCountry = data.country_name;
$('#country_code option').each((i, optionEle) => {
var countryName = optionEle.value.split('+')[0].trim();
if (yourCountry === countryName) {
optionEle.selected = true;
}
});
})
.fail(function (xhr, status, error) {
console.error(error);
});
})
</script>

@ -265,7 +265,7 @@
</div>
<p>
<select class="country_code" name="country_code">
<select class="country_code" name="country_code" id="country_code">
<option style="font-weight: 600;" value="United States +1">United States&nbsp; &nbsp;+1</option>
<option style="font-weight: 600;" value="United Kingdom +44">United Kingdom&nbsp; &nbsp;+44</option>
<option style="font-weight: 600;" value="Australia +61">Australia&nbsp; &nbsp;+61</option>
@ -691,4 +691,20 @@
}
});
})
</script>
<script>
$(function () {
$.getJSON("https://www.globalhighlights.com/index.php/location/get_country", function (data) {
var yourCountry = data.country_name;
$('#country_code option').each((i, optionEle) => {
var countryName = optionEle.value.split('+')[0].trim();
if (yourCountry === countryName) {
optionEle.selected = true;
}
});
})
.fail(function (xhr, status, error) {
console.error(error);
});
})
</script>
Loading…
Cancel
Save