【发布时间】:2012-05-08 07:41:48
【问题描述】:
我在我的 jsp 页面中使用 <detail:form> 和 <tags:field >。我尝试查看浏览器使用 firebug 生成的源代码,它向我显示表单名称是“checkForm”,并且所有字段名称都有 “check.”作为前缀。因此,其中一个字段(它是一个单选按钮)名称是 check.isEndorseByApplicant 。
What I am trying to achieve is, when a some element in a drop down menu is selected, I wanted to change the radio button from yes to no.问题是由于该字段的名称中包含点,所以我不能这样做。即 document.checkForm.check.isEndorseByApplicant 不适合我。目前我无法从字段名称中取出点。有任何想法吗?
function autoSelect(checkEndorsement)
{
alert(document.checkForm.check.isEndorseByApplicant)
if(checkEndorsement.value=="Student")
check.isEndorsedBy[0].checked=true;
else
check.isEndorsedBy[1].checked=true;
}
</html:javascript>
。 . .
<detail:form object="check" >
。 . . .
<td><tags:field property="isEndorseByApplicant" onclick="autoSelect(this.form);" /></td>
【问题讨论】:
标签: javascript html forms radio-button stripes