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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T22:31:28+00:00 2026-05-29T22:31:28+00:00

Using the Pluralsight demos found in asp.net I created autocomplete textbox. I want to

  • 0

Using the Pluralsight demos found in asp.net I created autocomplete textbox. I want to put information in the textbox and view the autocomplete suggestions in a table below the textbox without pressing a button.

I am writing my code in MVC3 and using MSSQL 2008 database.

I suspect that I need to somehow merge this functions, but I don’t know how

$(document).ready(function () {
$(":input[data-autocomplete]").each(function () {
    $(this).autocomplete({ source: $(this).attr("data-autocomplete") });
});

$("searchForm").each(function() {
    $.getJSON($(this).attr("action"),
        $(this).serialize(),
        function(data) {
            var result = $("#searchTemplate").tmpl(data);
            $("searchResults").empty()
                .append(result);
        }
    );
    return false;
}); })

Any help will be very appreciated.

  • 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-29T22:31:30+00:00Added an answer on May 29, 2026 at 10:31 pm

    Your question is very unclear. Can’t see any relation between the first and the second script. Not to mention that the second one seems wrong as there’s no <searchForm> valid DOM element which is what you seem to be looping through.

    It looks like you are trying to automatically perform a search by submitting the form containing the autocomplete textbox when a selection is made. For this you could use the select event:

    $(":input[data-autocomplete]").each(function () {
        $(this).autocomplete({ 
            source: $(this).attr("data-autocomplete"),
            select: function(event, ui) {
                // a selection was made, here you could trigger the submission of the form
                // as if a submit button was pressed
                $(this).closest('form').trigger('submit');
            }
        });
    });
    

    Of course if you wanted this form to perform an AJAX submit instead of a regular postback you could use an Ajax.BeginForm instead of a regular Html.BeginForm.

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

Sidebar

Related Questions

Using ASP.NET MVC there are situations (such as form submission) that may require a
Using preview 4 of ASP.NET MVC Code like: <%= Html.CheckBox( myCheckBox, Click Here, True,
I've managed to make it through the PluralSight tutorials on ASP.NET WebForms. While I
Using C# .NET 3.5 and WCF, I'm trying to write out some of the
Using VS2008, C#, .Net 2 and Winforms how can I make a regular Button
Is it possible to wrap a call using the TPL Library in .Net? I
Using WPF/PRISM I want to log my messages through ILoggerFacade to my GUI (A
I am using MySQL .net connector 6.4.4.0 and Entity Frame work 4.1 and trying
Using Git Bash or MinGW Shell , if I put in a command with
When I Google this, I find many places that recommend using the PluralSight tool

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.