html 형식의 입력이 있고 스크립트로 보내야합니다. 이름과 ID가 모두 있습니다.
<p>
<select onchange="myFunction(this.value)" name="shippcity" id="shippcity">
<option value="0">state</option>
</select>
<input type="hidden" name="calc_shipping_city" id="shipping_city" value="" />// will be removed
</p>
<script>
function myFunction(val) {
if ( val === '' ) {
}
else {
//input val to name="calc_shipping_city" and id="shipping_city"
document.getElementById("shipping_city").value = val;
}
}
</script>
woocomerce의 코드도 있습니다.
<?php
}
$my_city = $woocommerce->customer->get_shipping_city();
$my_city = explode('-', $my_city);
if(isset($my_city) && intval($my_city[0]) > 0 ){
?>
set_initial_val('shipp', 'city', <?php echo $my_city[0]; ?>);
각 입력 요소에는 value
설정할 수 있는 속성이 있습니다.
function myFunction(val) {
if ( val === '' ) {
}
else {
document.getElementById("shipping_city").value = val;
document.getElementById("shippcity").form.submit();
}
}
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다