2012-07-27 220 views
1

我在jsp頁面的div中增加了一個單選按鈕。但新添加的單選按鈕始終選中,當我點擊第二個單選按鈕時,它也將選擇。是否有任何腳本來寫入這個。兩個單選按鈕一次選擇

<div style="padding-left:15px"> 
     <div> 
      Entry Mode Code was: 
     </div> 
     <div style="padding-left:30px"> 
      <div> 
       <html:radio name="caseForm" property="questionnaire.RP0062.posEntryModeCd" value="A" styleId="posEntryModeCda"> 05 - Chip Card read (data is reliable)</html:radio> 
      </div>   
      <div> 
       <html:radio name="caseForm" property="questionnaire.RP2462.posEntryModeCd" value="B"> 90 - Magnetic Stripe Terminal and the full unaltered contents of the selected track is included</html:radio> 
      </div> 
      <div> 
       <html:radio name="caseForm" property="questionnaire.RP2462.posEntryModeCd" value="C" > Not Applicable</html:radio> 
      </div>   
     </div> 
    </div> 

附圖像: enter image description here

+1

請出示您的實際HTML輸出,而不是您的Java源代碼。附有圖片的 – 2012-07-27 14:12:56

+0

。 – Mdhar9e 2012-07-27 14:21:51

+1

我相信@Diodeus意味着**生成的** HTML輸出:)在瀏覽器中右鍵單擊頁面並執行*查看源代碼*。 – BalusC 2012-07-27 14:23:17

回答

5

您應該具有相同的值對所有三個單選按鈕的property屬性,即property="questionnaire.RP2462.posEntryModeCd"所有三個:

<div> 
    <html:radio name="caseForm" property="questionnaire.RP2462.posEntryModeCd" value="A" styleId="posEntryModeCda"> 05 - Chip Card read (data is reliable)</html:radio> 
</div>   
<div> 
    <html:radio name="caseForm" property="questionnaire.RP2462.posEntryModeCd" value="B"> 90 - Magnetic Stripe Terminal and the full unaltered contents of the selected track is included</html:radio> 
</div> 
<div> 
    <html:radio name="caseForm" property="questionnaire.RP2462.posEntryModeCd" value="C" > Not Applicable</html:radio> 
</div> 

希望這有助於

0

我輸入錯誤的名稱,而不是下面給出..

<html:radio name="caseForm" property="questionnaire.RP0062.posEntryModeCd" value="A" styleId="posEntryModeCda"> 05 - Chip Card read (data is reliable)</html:radio> </div>

上述我應該給questionnaire.RP2462.posEntryModeCd如下單選按鈕還具有。然後只有它工作。

謝謝..