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 6708327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:44:44+00:00 2026-05-26T07:44:44+00:00

I want the user to click on a button called select. This then selects

  • 0

I want the user to click on a button called select.
This then selects an option in the dropdownlist.
The option it selects must be the one that starts with the first 10 characters of the text in the text box.

This is the dropdown and textbox.

<asp:DropDownList runat="server" ID="selDealer"></asp:DropDownList>

<a href="#" class="RemoveLink" >Select</a>
Dealer Name: <asp:TextBox ID="RtnDealerName" runat="server"></asp:TextBox>

At the moment the jscript only does a simple alert to test the select link is working.

<script language="javascript" type="text/javascript">
 $(function () {       
         $(".RemoveLink").click(function () {
            alert("Yes");


        });
    });
</script>

What do i put in the script to select the dropdown option which starts with the first 10 characters of the text in the text box.

  • 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-26T07:44:45+00:00Added an answer on May 26, 2026 at 7:44 am
    $(".RemoveLink").click(function() {
        var regexpToSearch = new RegExp( $("#<%= RtnDealerName.ClientID %>").val().substring(0,10), 'i');
    
        var optionToSelect = $("#<%= selDealer.ClientID %> option").filter(function(index) {
            return this.innerText.search(regexpToSearch) != -1;
        }).first();
    
        if(optionToSelect.length != 0){
            $("#<%= selDealer.ClientID %>").val(optionToSelect.val());
        }
    });
    

    To check a last ten characters on textbox against last ten characters of an option change expression to create regexpToSearch as below:

        var selDealerText = $("#<%= RtnDealerName.ClientID %>").val();
        var regexpToSearch = new RegExp(selDealerText.substring(Math.max(selDealerText.length - 10, 0)) + '$', 'i');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose, I want to have a link or a button that when user click
I don't want to allow user to double click on my button. On the
I want to allow the user to click a start point and then click
I want to make it so that a user clicks a button to launch
When the user clicks a button, I want his browser to automatically scroll to
I want to, when the user clicks a button on my website, to make
When a user clicks a submit button I want the form to be submitted.
When the user clicks an Edit button on my form, I want a box
In my application when a user clicks on a button I want to open
I had image for Products and i want user when click on image appear

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.