0
1. Member Account Number<span class="bodyCopy"><font color="#ff0000"> * </font></span>:
<html:select name="reDataForm" property="member.accountNumber" styleClass="formContent"
style="width:80px" onchange="showfield(this.options[this.selectedIndex].value)">
<html:options collection="<%= WorkConstants.Dropdowns.PACCT %>" property="value"
labelProperty="label" styleClass="formContent"/>
</html:select>
<div id="div1"></div>
功能为如下:其他选项 - 如何设置值?
<script type="text/javascript">
function showfield(name){
if(name=='Other')
document.getElementById('div1').innerHTML='<html:text name="reDataForm" property="member.accountNumber" styleClass="formContent" maxlength="9" size="9"/>';
else
document.getElementById('div1').innerHTML='';
}
</script>
的问题是:如果我选择选项“其他”,文字下方的设计出现。但值member.accountNumber没有设置到它。我可以看到帐号为“其他”。而不是我在文本框中输入的值。为什么?我该如何设置?
让我怎么做呢?我应该在脚本中使用 RMa 2011-02-13 03:06:12