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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T23:33:11+00:00 2026-06-05T23:33:11+00:00

I am abviously missing something, but I keep getting this message when trying to

  • 0

I am abviously missing something, but I keep getting this message when trying to add auto complete to a text box: .autocomplete is not a function

_Layout (Only the head section):

<head>
 <meta charset="utf-8" />
 <title>@ViewBag.Title - My ASP.NET MVC Application</title>
 <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
 <meta name="viewport" content="width=device-width" />
 <link href="../../Content/themes/base/jquery.ui.all.css" rel="stylesheet" type="text/css" />
 <script src="../../Scripts/jquery-1.6.2.min.js" type="text/javascript"></script>
 <script src="../../Scripts/jquery-ui-1.8.11.js" type="text/javascript"></script>
 @Styles.Render("~/Content/themes/base/css", "~/Content/css")
 @Scripts.Render("~/bundles/modernizr")

Index:

    <script type="text/javascript">
$(function () {
    $("#searchTerm").autocomplete({
       source: "/Search/AutocompleteSuggestions",
       minLength: 3,
       select: function (event, ui) {
             if (ui.item) {
                $("#searchTerm").val(ui.item.value);
                $("form").submit();
             }
       }
      });
});

@using (Html.BeginForm(new { ReturnUrl = ViewBag.ReturnUrl }))'
{
<input id="searchTerm" name="searchTerm" type="text" />
<input type="submit" value="Go" />
}

I am pretty sure that the Jquery plugin is not loading correctly but I can’t see why!

  • 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-05T23:33:12+00:00Added an answer on June 5, 2026 at 11:33 pm

    After scratching my head for an hour or so I found the problem, so here goes:

    1. You must add your javascript to the @section Scripts {} section
    2. I had to include the following packages:
      @Scripts.Render(“~/bundles/jqueryval”)
      @Scripts.Render(“~/bundles/jqueryui”)

    MVC4 ships with the correct JQuery files and the default configuration already includes the necessary packages.

    Hope this helps someone else.

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

Sidebar

Related Questions

OK, I'm feeling like this should be easy but am obviously missing something fundamental
I'm sure this is basic stuff but I'm obviously missing something. I want to
So, this may be a really stupid question, but I'm obviously missing something here.
My problem is that I'm trying to add a child entity, but keep running
Potentially embarrassing question, but there is obviously something I'm missing that I want/need to
I'm a newbie in ASP.net MVC 3. I'm trying to do something trivial, but
Seems like a simple issue but I'm obviously missing something. I have a ViewBag
I had this working in prototype.js but it conflicted with a few script files.
I'm trying to use Castle Windsor to create my message handlers because just using
Real Dumb question. I figured I would have gotten this straight by now, but

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.