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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T20:48:44+00:00 2026-05-17T20:48:44+00:00

imagine i have one textbox (with autocomplete 1.1, not the latest UI version) and

  • 0

imagine i have one textbox (with autocomplete 1.1, not the latest UI version) and a checkbox.
The textbox triggers an asp.net .ashx page that will execute a stored procedure at the sql-server and return the results.

It’s all working, but i want to add another feature.
When the checkbox is checked i want stored_procedure_1 to be executed.
If the checkbox is unchecked, stored_procedure_2 must be executed.
The checkbox is unchecked by default.

My question:
How do i tell the ashx page if the checkbox is checked or not..?
By default the autocomplete will trigger something like: autocompletedata.ashx?q=myname and that will execute stored_procedure_2, but when the checkbox is checked it must trigger autocompletedata.ashx?q=myname&mycheckbox=begin so that stored_procedure_1 will be executed.

Do i have to add some jQuery code to pass the checked checkbox?
I am totally lost..

Thanks in advance.

Form elements:

<input id="search_employee" type="text" class="employee" />
<input type="checkbox" name="mycheckbox" value="begin" />

jQuery:

 $().ready(function() {

        $("#search_employee").autocomplete("includes/AutocompleteData.ashx", {
            minChars: 3,
            max: 15,
            selectFirst: false,
            scrollHeight: 300,
            formatItem: function(data, i, n, value) {
            if (value.split("_")[3]!== null)
            {
            return "<img style = 'width:40px;height:53px;float:left; margin:2px 5px 2px 0' src='/pictures/thumbs/"
            + value.split("_")[3] + "'/> " + value.split("_")[0] + "<br /><span class=smallname>" + value.split("_")[2] + "<br/>" + value.split("_")[4] + "</span>";
        } 
    },
            formatResult: function(data, value) {
                return value.split("_")[0];
            }
        });

Part of autocompletedata.ashx :

Dim searchname As String = context.Request.QueryString("q")
Dim searchstart as string = context.Request.QueryString("mycheckbox")
Dim searchsql as string

if searchstart = "begin" then
   searchsql = "stored_procedure_1"
else
   searchsql = "stored_procedure_2"
end if

Dim conn As SqlConnection = New SqlConnection
conn.ConnectionString = ConfigurationManager.ConnectionStrings("MyConn").ConnectionString
Dim cmd As SqlCommand = New SqlCommand
cmd.CommandType = Data.CommandType.StoredProcedure
cmd.CommandText = searchsql.ToString
cmd.Parameters.AddWithValue("@SearchText", searchname)         
  • 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-17T20:48:45+00:00Added an answer on May 17, 2026 at 8:48 pm

    You can use .setOptions to set additional parameters:

    ac.setOptions({ params: { paramOne:'somevalue', somethingelse:'foobar' } });
    

    That is the programmatic way, but in your case:

    $("#search_employee").autocomplete("includes/AutocompleteData.ashx", {
       params: { flag:'true' }, // just grab the checked attr beforehand
         ...//rest of your AC stuff
    

    That will perform the following HTTP GET:

    GET: includes/AutocompleteData.ashx?flag=true
    

    Allowing you to access it via the Request.QueryString collection in the ASHX.

    EDIT

    My bad – i was thinking another version of AC.

    I think the param is called “extraParams”:

    $("#search_employee").autocomplete("includes/AutocompleteData.ashx", {
       extraParams: { flag:'true' }
    

    Try them both, one will/should work. 🙂

    HTH.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

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.