电话区号下拉框添加IP判断

master
LiaoYijun 1 year ago
parent ac94a5fc71
commit 167ef36e1c

@ -255,7 +255,7 @@
<div class="requiredArea" style="margin-top:-10px;">Please verify your email.</div>
</div>
<select name="country_code" class="country_code">
<select name="country_code" class="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>
@ -692,6 +692,22 @@ function validateQuickInquiryForm() {
});
})
</script>
<script>
$(function () {
$.getJSON("https://www.chinahighlights.com/guide-use.php/apps/ip2location/index/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>
<style>
.date_select {width: 31%;

@ -114,7 +114,7 @@ background: #fff;margin-top: 15px; margin-bottom: 20px;">
<div id="ticket_email_verify_errmsg" style="display: none">
<div class="requiredArea" style="margin-top:-10px;">Please verify your email.</div>
</div>
<select name="country_code" class="country_code">
<select name="country_code" class="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>
@ -597,6 +597,23 @@ background: #fff;margin-top: 15px; margin-bottom: 20px;">
return result;
}
</script>
<script src="https://data.chinahighlights.com/js/min.php?f=/js/jquery-1.8.2.min.js,/js/jquery.mailAutoComplete-4.0.min.js&amp;v=20231110"></script>
<script>
$(function () {
$.getJSON("https://www.chinahighlights.com/guide-use.php/apps/ip2location/index/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>
<style>
.minaddBtn { width:auto !important;}
.optionLable input[type="radio"]+label {min-height: auto;}

Loading…
Cancel
Save