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'm working with ASP.NET MVC and jQuery and I have a UserControl that is
I have just started working in jQuery and ASP.NET MVC. I want the same
Fairly new to asp.net Mvc and jquery. Have the following code working fine, but
background:Me and my coworkers are working on asp.net mvc project ... we have a
I'm working on a new ASP.NET MVC / JQuery app which will need to
I am working with ASP.NET MVC 3 and jQuery 1.5. Somewhere in my code
I'm working on an ASP.NET MVC project using jQuery. I'm referencing the jQuery VSDoc
I am working on an ASP.NET MVC application and using jQuery. I understand from
I have asp.net mvc application. i want to configure the object in jquery and
I am currently working on an ASP.NET MVC 3 app where I have a

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.