1.>Create Jquery Function
function GetSelectedText() {
var drp = document.getElementById("<%=drpCustomer.ClientID%>");
var selectedValue = drp.options[drp.selectedIndex].text.split('~')[0];
var txtNo = document.getElementById("<%=txtNo.ClientID%>");
txtNo.value = selectedValue;
}
2.>Call JQuery Function On DropDownList Change Event
<asp:DropDownList ID="drpCustomer" runat="server"
onchange="GetSelectedText();">
</asp:DropDownList>
function GetSelectedText() {
var drp = document.getElementById("<%=drpCustomer.ClientID%>");
var selectedValue = drp.options[drp.selectedIndex].text.split('~')[0];
var txtNo = document.getElementById("<%=txtNo.ClientID%>");
txtNo.value = selectedValue;
}
2.>Call JQuery Function On DropDownList Change Event
<asp:DropDownList ID="drpCustomer" runat="server"
onchange="GetSelectedText();">
</asp:DropDownList>
No comments:
Post a Comment