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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:26:11+00:00 2026-05-26T20:26:11+00:00

I am calling a web service (using SPServices) to get all of my items

  • 0

I am calling a web service (using SPServices) to get all of my items into an array, then using that array in my autocomplete call. It works great, however I have a few questions/issues

  1. How can I deny the user from selecting values which are not in the pick list? I think a combo box does this, however I don’t want to load up the entire list onto the page… which leads to #2

  2. I am using a picker list which will have a few thousand items in it (currently a few hundred), from what I’m gathering with autocomplete it loads up all of the choice values into an array and then uses that to pick from. is that correct? Is there a better way around this so I can call a web service with my partially entered words, and only array the results, not all of the items? Will this be a unique solution outside of autocomplete or combobox?

Thanks,
David

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

    So here’s what I did…

    On key up, call my web service with the new term, and then put the returned results into the autocomplete. Also the results are then cached.

    I am also checking when the user continues that the value specified is contained in the array, ensuring they didn’t mess with the value.

    function setVendorLookup() {
        var term = $(this).val().toLowerCase();
        if (term.length > 2) {
            if (vendors.join(" ").toLowerCase().indexOf(term) == -1) { //some caching
                vendors = [];
                $().SPServices({
                    operation: "GetListItems",
                    listName: "Yellow Pages",
                    async: false,
                    CAMLViewFields: "<ViewFields><FieldRef Name='VENDOR_ID'/><FieldRef Name='NAME1'/><FieldRef Name='CITY'/><FieldRef Name='STATE'/></ViewFields>",
                    CAMLQuery: "<Query><Where><Or><Contains><FieldRef Name='VENDOR_ID' /><Value Type='Text'>" + term + "</Value></Contains>" +
                        "<Contains><FieldRef Name='NAME1' /><Value Type='Text'>" + term + "</Value></Contains></Or></Where></Query>",
                    completefunc: function (xData, Status) {
                        $(xData.responseXML).find("[nodeName='z:row']").each(function () {
                            vendors.push($(this).attr("ows_VENDOR_ID") + " - " + $(this).attr("ows_NAME1") + ", " + $(this).attr("ows_CITY") + ", " + $(this).attr("ows_STATE"));
                        });
                    }
                }); //SPServices
            }
            $(".vendor").autocomplete({
                source: vendors,
                minLength: 3
            });
        } else
            vendors = [];
    
    }
    
    function validate()
    {
            if (jQuery.inArray($(".vendor").val(), vendors) == -1) {
                myAlert("Validation Error", "Please select a valid vendor");
                return false;
            }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am calling a WSDL web service from Python using SOAPpy . The call
I am using calling web services and using WCF generated service-reference on the client.
I'm trying to retrieve product information from magento by calling its web service using
I'm calling a web service from a console app - all in C# on
We've having trouble deploying a web service that works in our development environment, but
I am experimenting with calling a web-service using jQuery. For some reason the result
I have some problem with calling web service from flex. I have service with
My app is calling a web service to retrieve some data, and I want
I am calling a web service to return XML data for states/provinces of countries.
I'm calling a web service and returning the following data in JSON format: [{OrderNumber:12345,CustomerId:555}]

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.