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

  • SEARCH
  • Home
  • 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 3315890
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:24:15+00:00 2026-05-17T22:24:15+00:00

I have an AjaxControlToolkit.AutoCompleteExtender control attached to a textbox, and three radio buttons. When

  • 0

I have an AjaxControlToolkit.AutoCompleteExtender control attached to a textbox, and three radio buttons. When the user selects a radio button, the service method used to retrieve the values listed in the AutoCompleteExtender is changed, as follows:

$("#radioButtonList input").click(function() {

    var selectedValue = $(this).val();

    if (selectedValue == 0) {
        $find('autoCompleteExtender').set_serviceMethod('AutoCompleteExtenderMethod1');
    }
    else if (selectedValue == 1) {
        $find('autoCompleteExtender').set_serviceMethod('AutoCompleteExtenderMethod2');
    }
    else if (selectedValue == 2) {
        $find('autoCompleteExtender').set_serviceMethod('AutoCompleteExtenderMethod3');
    }

    $('#textbox').focus();
}

I want to ensure that, if the user selects a radio button when text is already present in the textbox, the list of autocomplete values based on the new service method is displayed (just as it would be if the user clicked the radio button and then typed into the textbox).

I have tried various event-firing mechanisms, such as this:

var press = jQuery.Event("keypress");
press.ctrlKey = false;
press.which = 77;
$('#textbox').trigger(press);

…each of these…

$('#textbox').keydown();
$('#textbox').keypress();
$('#textbox').keyup();

and even:

$('#textbox').get(0).value += 'm';

but nothing seems force the correct events to fire in order to make the autocomplete list re-display with the results of the new service method. How can I make this happen using Javascript?

EDIT: I should note: the jQuery events are firing correctly in each of the above cases, they’re just not causing the autocomplete list to reappear when they do. I figure I haven’t yet struck the right combination of events that the autocompleteextender is expecting to force the list to appear.

  • 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-05-17T22:24:15+00:00Added an answer on May 17, 2026 at 10:24 pm

    Make sure that you bind your events in the $(document).ready() function. The following works correctly

          <html>
           <head>
            <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript">
                </script>
                <script>
                 $(document).ready(function(){
        $("#radioButtonList input").change(function() {
    
            var selectedValue = $(this).val();
    
            if (selectedValue == 0) {
               $find('autoCompleteExtender').set_serviceMethod('AutoCompleteExtenderMethod1');
    
            }
            else if (selectedValue == 1) {
              $find('autoCompleteExtender').set_serviceMethod('AutoCompleteExtenderMethod2');
    
            }
            else if (selectedValue == 2) {
              $find('autoCompleteExtender').set_serviceMethod('AutoCompleteExtenderMethod3');
    
            }
    //force click on text box
         $('#textbox').click()
          $('#textbox').focus();
        });
    //handle click event
        $("#textbox").click(function(){
         alert("textbox clicked")
         //handle your refresh action for the textbox here
        })
        })
    
        </script>
        </head>
        <body>
        <input id="textbox" type="text" value="test">
        <div id="radioButtonList">
        <input type="radio" value="0">
        <input type="radio" value="1">
        <input type="radio" value="2">
        </div>
        </body>
        </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple Asp.NET webform with a TextBox. I have attached an AjaxControlToolkit
We have an AutoCompleteExtender linked to a TextBox. Both controls are placed inside an
I have an asyncfileupload control that I'm using from the ajaxcontroltoolkit. On the file
I have used the above control on a register form. An example of the
I have simple user control with include ajax control - CalendarExtender. This is code:
I have an AjaxControlToolkit DynamicPopulate control that is updated by calls to a WCF
I have a user control with a updatepanel, script manager and a asyncfileupload control.
I Have a TextBox outside the UpdatePanel and a Button inside the Updatepanel When
I have to display a popup when user clicks on Place button inside a
Currently I have a custom user control and within it is a little form

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.