//
下拉选择,文本输入框同步
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 >
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 >