下拉列表跟文本框同步

it2022-05-09  36

// 下拉选择,文本输入框同步 function ShowReasonInTextBox(ddl, txtId) { var nowText = ddl.options[ddl.selectedIndex].text; if (nowText != "" ) { document.getElementById(txtId).value = nowText; }s else { document.getElementById(txtId).value = "" ; } } // 下拉列表 < asp:DropDownList ID = " ddlReason0 " runat = " server " style = " width:600px; " AutoPostBack = " false " onchange = " ShowReasonInTextBox(this,'Reason'); " > </ asp:DropDownList > < asp:DropDownList ID = " ddlReason1 " runat = " server " style = " width:600px; " AutoPostBack = " false " onchange = " ShowReasonInTextBox(this,'Reason'); " > </ asp:DropDownList > < asp:DropDownList ID = " ddlReason2 " runat = " server " style = " width:600px; " AutoPostBack = " false " onchange = " ShowReasonInTextBox(this,'Reason'); " > </ asp:DropDownList > // 多行文本框 < textarea id = " Reason " runat = " server " style = " width: 600px; " class = " input " rows = " 8 " ></ textarea >

转载于:https://www.cnblogs.com/yy-sun/archive/2011/03/29/1998777.html


最新回复(0)