【发布时间】:2013-03-14 13:15:38
【问题描述】:
我想根据组合框的选定值设置文本框的可见性。 这是我的代码:
<table width="500" align="center">
<tr>
<td><span> Name:</span></td>
<td><input name="name" type="text" id="name" size="40" class=""/></td>
</tr>
<tr>
<td><span>Email ID:</span></td>
<td><input name="email" type="email" id="email" size="40" class=""/></td>
</tr>
<tr>
<td><span>Select:</span></td>
<td>
<select id="edition">
<option value="none" selected>----Select ----</option>
<option id="1">A</option>
<option id="2">B</option>
</select>
</td>
</tr>
<tr>
<td><span>Number of Licenses</span></td>
<td><input type="text" id="licenseNo" size="5" value="30" /></td>
</tr>
</table>
如果组合框的值为 B,我希望 licenseNo 文本框可见。我不知道该怎么做。
【问题讨论】:
-
你可以通过javascript做吗?
-
是的。最好使用javascript
-
我更新了答案。刚刚添加了 tr 并给了它 id 。现在您可以隐藏整行了。
标签: php javascript html combobox