【发布时间】:2010-03-23 13:52:48
【问题描述】:
我的设置是这样的:
radiobutton1 - selection1
radiobutton2 - selection2 textinput1
我希望在 selection1 更改时选择 radiobutton1,并且我希望在 selection2 或 textinput1 更改时选择 radiobutton2。
这里必须有一个简单的 javascript 解决方案...我只是找不到它。
这是我的实际代码(“$semopt”是一个字符串,其中包含第一个选择输入中选项的 html 代码):
<input type='radio' name='semester' value='existing'/>Existing semester:
<select name='sem_id'">$semopt
</select><br/>
<input type='radio' name='semester' value='new'/>New Semester:
<select name='sem_name'">
<option value='Fall'>Fall</option>
<option value='Spring'>Spring</option>
</select>
<input name='sem_year' value='$thisyear' size='5'"/><br/>
【问题讨论】:
标签: javascript select text radio-button onchange