JavaScript实现dropdownlist选定值后将选定值的key与value填入两个textbox中

时间:2021-12-11 21:51:33
   <script language="javascript" type="text/javascript">
var txtText0 = "#" + '<%= new DynamicControl(this, "Text0").ClientID%>';//vendor#
var txtText1 = "#" + '<%= new DynamicControl(this, "Text1").ClientID%>';//vendor name
var dplVendor = "#" + '<%= new DynamicControl(this, "FUVendor").ClientID%>'; $(function () { $(dplVendor).change(function () {
$(txtText0).val($(dplVendor).val());
$(txtText1).val($(dplVendor).find("option:selected").text());
}); }); </script>