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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:47:02+00:00 2026-05-26T10:47:02+00:00

I’m trying to figure out what I’m doing wrong here. Using autocomplete I’m getting

  • 0

I’m trying to figure out what I’m doing wrong here. Using autocomplete I’m getting data that’s being returned with JSON data ….

Here’s the JSON data thats returning from the QUERY.

 [{"value":"Company Test 1 Manager Test 1 111-111-1111","Company_Name":"Company Test 1","Manager":"Manager Test 1","Phone":"111-111-1111","Contacted":"1"},
 {"value":"Company Test 2 Manager Test 2 222-222-2222","Company_Name":"Company Test 2","Manager":"Manager Test 2","Phone":"222-222-2222","Contacted":"0"},
 {"value":"Company Test 3 Manager Test 3 333-333-3333","Company_Name":"Company Test 3","Manager":"Manager Test 3","Phone":"333-333-3333","Contacted":"0"},
 {"value":"Company Test 4 Manager Test 4 444-444-4444","Company_Name":"Company Test 4","Manager":"Manager Test 4","Phone":"444-444-4444","Contacted":"1"},
 {"value":"Company Test 5 Manager Test 5 555-555-5555","Company_Name":"Company Test 5","Manager":"Manager Test 5","Phone":"555-555-5555","Contacted":"0"},]

Now, here’s my JQuery (using JQuery 1.6.2)

<script type="text/javascript">
$(function() {
    $('#Company_Name').val("");
    $('#Manager').val("");
    $('#Phone').val("");
    $('#Contacted').val("");

           $("#autoSearch").autocomplete({
                source: "UPDATE.test001QUERY.php",
                minLength: 2,
                select: function(event, ui) {
                        $('#Company_Name').val(ui.item.Company_Name);
                        $('#Manager').val(ui.item.Manager);
                        $('#Phone').val(ui.item.Phone);

                    if ('#Contacted' == [1]) {
                            $('#Contected').prop('checked', true);
                            } else {
                            $('#Contected').prop('checked', false);
                            }

                }
            });
     }); 
</script>

What did I do wrong? The autocomplete works fine but the checkbox does not “check” based on the “0” or “1” thats returned from the QUERY.

  • 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-26T10:47:03+00:00Added an answer on May 26, 2026 at 10:47 am

    I think

    if ('#Contacted' == [1])

    should be

    if (ui.item.Contacted === "1")

    Edit,

    the first thing you need to do is determine if the if statement in your select callback is being entered under the correct circumstances.

    if it is, you need to figure out why you are not modifying the right dom. So I see your selector is #Contected. Are you sure you have a checkbox with an id attribute Contected? Should it be Contacted?

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

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to create an if statement in PHP that prevents a single post
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running 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.