因此,我知道字段是正确命名的,但是当检查复选框时,JavaScript仍未复制信息。我已经仔细检查过,字段中的所有内容都匹配。
JavaScript:
function FillShiping(f) {
if(f.shipingtoo.checked == true) {
f.shipto.value = f.billto.value;
f.shipaddress.value = f.Address.value;
f.shipcity.value = f.City.value;
f.shipstate.value = f.State.value;
f.shipzip.value = f.Zip.value;
}
if(f.shipingtoo.checked == false) {
f.shipto.value = '';
f.shipaddress.value = '';
f.shipcity.value = '';
f.shipstate.value = '';
f.shipzip.value = '';
}
}
HTML:
<div class="fb-checkbox">
<input type="checkbox" onclick="Fillshiping(this.form)" name="shipingtoo">
<span class="fb-fieldlabel" id="item61_0_span">Check this if shipping address is same
as billing address </span>
</label>
</div>
</div>