Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8486975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T21:06:10+00:00 2026-06-10T21:06:10+00:00

I have a textbox and a DropDownList. The DropDownList is populated based on the

  • 0

I have a textbox and a DropDownList. The DropDownList is populated based on the input in the textbox. There are a few problems I’m having where the DropDownList isn’t being populated correctly.

One is when I type something into the textbox I can tab to the DropDownList and have it filled correctly. But if I decide I want to change what is in the textbox and type something else into it and then try to tab to the DropDownList again it doesn’t update.

Another problem is when I start typing into the textbox I have an autocomplete list that pops up and I can click an option to have it fill the textbox in for me, but when I do this the DropDownList is not being populated.

This is the javascript I have to get the DropDownList filled.

$('#textFrame').live('change', function (event) {
    $.ajax({
        type: 'POST',
        url: '@Url.Action("GetDirectors", "HostScan")',
        data: { frame: $(this).val() },
        success: function (data) {
            var markup = '';
            for (var x = 0; x < data.length; x++) {
                markup += '<option value="' + data[x].Value + '">' + data[x].Text + '</option>';
            }
            $('#DirectorList').html(markup).show();
        }
    });

});

What should I change to make this work?

Thanks in advance for your help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T21:06:11+00:00Added an answer on June 10, 2026 at 9:06 pm

    First thing is that .live is deprecated as of jQuery 1.7.0. Try using .on instead.

    Secondly use the jQuery file hosted by google cdn.. It will help reduce your site’s bandwidth.

    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
    

    As for the code try clearing up the options before you append new values. This makes sure you are not adding new options to the previous options.

    $(function(){
    
        $('#textFrame').on('change', function () {
            $.ajax({
                type: 'POST',
                url: '@Url.Action("GetDirectors", "HostScan")',
                data: { frame: $(this).val() },
                success: function (data) {
                    if(data != null){
                    var markup = '';
                    $('#DirectorList').find('option').remove();
                        for (var x = 0; x < data.length; x++) {
                            markup += '<option value="' + data[x].Value + '">' + data[x].Text + '</option>';
                        }
                    $('#DirectorList').append(markup).show();
                    }
                }
            });
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to validate TextBox based on Value selected in DropDownList controls. I have
I have a DropDownList populated with a SelectList generated from (an anonymous type) that
I have a dropdownlist and a textbox with a button on a form. When
I have got a dropdownlist, a submit button and a textbox in my view.
I have update panel that content check box, textbox, 3 DropDownList with CascadingDropDown extender.
I have a textbox and dropdown inside a <td> based on certain condition I'll
I have a textbox and a dropdownlist the textbox has <asp:TextBox ID=TxtInizioPeriodo runat=server ontextchanged=InizioPeriodo_TextChanged
I have added a textbox, a dropdownlist, a checkbox, a button, and an update
I have a simple datalist with a dropdownlist and a textbox. When the dropdownlist
I have code to append value from dropdownlist to the textbox. But I am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.