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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T19:26:35+00:00 2026-05-12T19:26:35+00:00

So I am working with ASP.Net MVC + jQuery autocomplete and I have a

  • 0

So I am working with ASP.Net MVC + jQuery autocomplete and I have a field where I enter an employee. As of right now I have it autocompleting on the employee name and populating a hidden field with the employee id (ajax returns a json object). With autofill set to true it is guaranteed to enter a valid employee id if their search yields a match, but I don’t believe it’s good practice to allow them to enter some bogus non-autocompleted name when they submit as it will only result in an error.

Is there any way to allow only autocompleted values in the text box? I’d like this to be as solid as possible (not using the blur event allowing them to use a bad value for a short period of time).

UPDATE

I’m apparently blind as I have just discovered the mustMatch option. I’m not sure if I should delete this or not as I’ve answered my own question. I will leave it up here in case anyone else needs to know or until someone tells me it should be deleted.

  • 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-12T19:26:35+00:00Added an answer on May 12, 2026 at 7:26 pm

    The jquery autocomplete plugin has a must match option. It’s in the documentation. This is something from my own code, it has more, but you get the point.

        $('.myfav').live("click", function () {
            autocomplete("somefile.php", {max: 15, mustMatch: true})
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working with jQuery Form and ASP.NET MVC. Preview 5 of ASP.NET MVC
I've just started working with ASP.NET MVC now that it's in beta. In my
I've been working with ASP.NET MVC for the last few weeks, learning as I
I am working on an ASP.NET MVC web app that allows people to publish
I'm working in an ASP.NET MVC Beta 1 project, and I've noticed that if
I am working on an ASP.NET MVC application that contains a header and menu
I am working on an ASP.NET MVC application where I need to export data
I'm working with a ASP.NET MVC solution in a test driven manner and I
I'm working on an ASP.NET MVC application. The app is broken up into a
I'm working on an asp.net-mvc application. The linq data context is being passed into

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.