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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:06:55+00:00 2026-06-14T15:06:55+00:00

I have done so much R & D for Jquery Auto complete, I found

  • 0

I have done so much R & D for Jquery Auto complete, I found some result but not as much i needed. I am giving you code which are currently i am using .

    <ul>
         @foreach (var items in Model)
            {
             <li class="@items.ShortDesc" id="@items.ShortDesc">
                <div class="test0">             
                @Html.TextBox(@items.ShortDesc, @items.SfldDefault, new { @class = "catalog inputcatalog txtbox" })          
                                </div>  
                        </li>

                    }
                </ul> This  input  box will  created  by  Dynamic using forloop

// My Jquery Code

     $(function () {
    $("#Subject").autocomplete({
        source: '/Cataloging/Bib/GetSubject',
        minLength: 1,
        select: function (event, ui) {
            // Do something with "ui.item.Id" or "ui.item.Name" or any of the other properties you selected to return from the action
        }
    });
});   

// My Action Method

  public ActionResult GetSubject(string term)
    {
         term = term.Substring(2, term.Length-2);

        return Json(db.BibContents.Where(city => city.Value.StartsWith(term)).Select(city => city.Value), JsonRequestBehavior.AllowGet);
    }

// My code is running with static input but while creating Dynamic I need to use live event but i don’t know how can i use Live Event with this code.

NOTE: I am using static value of input “|a” after rendering on action i am removing that first two char to make proper search from database.
Thanks

  • 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-14T15:06:56+00:00Added an answer on June 14, 2026 at 3:06 pm

    Change this to make the same class for all txtboxes

        <li class="ShortDesc" id="@items.ShortDesc">
    

    .

    $(document).ready(function () { 
        $('.ShortDesc').each(function () { 
                $(this).autocomplete({ 
                    source: '/Cataloging/Bib/GetSubject',
                    minLength: 1,
                    select: function (event, ui) {
                // Do something with "ui.item.Id" or "ui.item.Name" or any of the other properties you selected to return from the action
            }
        });
    });
    

    $(Document).ready() should happen after all the Razor Commands are finished

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

Sidebar

Related Questions

I have done this without much effort on T-SQL, but I want to implement
I have never really done much C but am starting to play around with
I have built a PHP calendar system and have pretty much everything done but
Have done some research and found some stuff that may be helpful. I would
I have done some looking and I found this: http://www.codeproject.com/Articles/14439/The-ScrollableListBox-Custom-Control-for-ASP-NET-2 but to me it
I havent had much exposure to the Canvas element in HTML5. I have done
I'm learning C by translating some of the things I have done in Python
So i have done this simple task but i don't see why this is
I have some C code that I'd like to port to java. I haven't
I have done quite a bit of research on this but I'm still having

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.