You must Sign In to post a response.
  • Category: JQuery

    To select a value in the dropdown based on value entered in text box

    I have a text box and a dropdown. once i enter a value in the textbox,i need to select that value the dropdown that contains that particular and it shoud select the first value in the dropdown that matches the text.

    Suppose i have dropdown with values

    and i entered item in the textbox.
    it should select "itemone" in the dropdown.
    Can someone help please?
  • #761386
    can someone help please

  • #761389
    I agree with the post.

    ???????????? ????????????????? ??????????????????

  • #761391
    you can use the following logic in javascript.

    var DropDownCtrl = document.getElementById("DDControl");

    for loop..
    if(TxtBoxValue = e.options[i].value)
    e.options[i].selected = "selected"

    By Nathan
    Direction is important than speed

  • #761433

    Refer the below code :

    function SetValue() {

    var textval = document.getElementById('<%=textbox1.ClientID%>');
    var ddlPaymentStatus = document.getElementById("<%=ddlPaymentStatus.ClientID %>");

    if (textval.value != "" && textval.value != null) {
    // If data is there select "Paid" from DropDownList.
    selectItemByValue(ddlPaymentStatus, 1);
    else {
    // If data is not there, then select "--Select--" from DropDownList.
    selectItemByValue(ddlPaymentStatus, 4);

    You can refer the below link :

    Hope this will help you.

    Nirav Lalan
    DNS Gold Member
    "Failure is the path of least persistence"

  • Sign In to post your comments