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