复选框不会将确切的值复制到其他字段

时间:2014-01-04 15:08:39

标签: javascript performance

我有5个6个字段,我需要在6个字段下面获取数据。这里的问题是某些值没有在相应的文本字段中复制。 我也发布了我的HTML。它的形式很小。

我的html也包含了js。

<input class="width_367" type="text" name="fname" id="email" required>

<input class="width_367" type="text" name="mname" id="pass" required>

<input class="width_367" type="text" name="lname" id="email" required>

<input class="width_367" type="text" name="address" id="address" required>

<input class="width_367" type="text" name="city" id="city"  required>

复选框:

<p align="left" style="width: 425px !important;">

<input type="checkbox" name="chkOption" value="yes">

&nbsp;Check here if Recipient Address is the same as Billing Address </p>

<input class="width_367" type="text" name="rfname" id="email" />

<input class="width_367" type="text" name="rmname" id="pass" />

<input class="width_367" type="text" name="rlname" id="email" />

<input class="width_367" type="text" name="raddress" id="address" />

<input class="width_367" type="text" name="rcity" id="city" />

onclick="javascript: if (chkOption.checked){

  rfname.value=fname.value;
  rmname.value=mname.value;
  rlname.value=lname.value;                                         
    raddress.value=address.value;
    rcity.value=city.value;
    rstate.value=state.value;                       
    recstate.value=usestate.value;
    rCountry.value=Country.value;
    rzip.value=zip.value;
    remail.value=email.value;
}else{
    rfname.value = '';
    rmname.value = '';
    rlname.value = '';
    raddress.value = '';
    rcity.value = '';
    rstate.value = '';
    recstate.value = '';
    rCountry.value = '';
    rzip.value = '';
    remail.value = '';
  }"

0 个答案:

没有答案