Thursday, 14 December 2017

Set DropDown Seleted Text in TextBox Using Jquery

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>

No comments:

Post a Comment

React Hooks - custom Hook

  v CustomHook Ø React allows us to create our own hook which is known as custom hook. Example – 1 localStorage Demo Step-1 Create ...