使用Struts框架在JSP中使用表单输入的单选按钮

时间:2015-07-10 20:17:20

标签: java html jsp radio-button struts-1

我正在尝试创建一个页面来初始化要使用的地理位置API。此页面将有两个单选按钮可在选项之间切换。我创建了两个单选按钮:

<tr>
    <td colspan="2">
       <bean:message key="config.geolocation.page.text"/>
    </td>
</tr>
<tr>
    <td class="odd" width="20%" nowrap>
       <bean:message key="editvarref.header.geolocation.pick.api"/>
    </td>
    <td class="odd" width="80%">
       <div>
         <html:radio styleId="logo_type_0" property="b_type" value="0" onclick="show_logo(false)" />
        <label for="b_type_0"><bean:message key="geolocation.use.google"/></label>
       </div>
       <div style="padding-top:5px; padding-bottom:5px;">
          <html:radio styleId="b_type_1" property="b_type" value="1" onclick="show_logo(true)" />
          <label for="bo_type_1"><bean:message key="geolocation.use.skyhook"/></label>
       </div>
     </td>
</tr>

如何修改单选按钮以显示用户可以输入值的不同输入字段。我试图让两个单选按钮显示不同的输入字段。因此,当选择一个时,它将显示某些字段,当点击另一个时,它将显示不同的字段。这些字段将是一个文本框,用户可以在其中输入信息

1 个答案:

答案 0 :(得分:0)

<强> SCRIPT

<input type="radio" name="radio1" value="Show" onClick="getResults(this)">
Do nothing                                                         
<input type="radio" name="radio1" value="Nothing" onclick="getResults(this)">

<强> HTML

SELECT   * 
FROM     tbl_post 
ORDER BY id DESC offset 100 limit 5;