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

  • Home
  • SEARCH
  • 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 749477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T14:26:21+00:00 2026-05-14T14:26:21+00:00

I am using a combination of PHP, jQuery and Spry to serve a series

  • 0

I am using a combination of PHP, jQuery and Spry to serve a series of listboxes in which a user will select first the type of vehicle, then the make, then the model and finally the specific model.

All my listboxes (SELECT) are working fine, and they update properly using the Spry elements. Each listbox is populated from a different Spry XML Dataset, and this is my problem.

If I present all four listboxes to the user, the script has to go and fetch all four lots of XML to populate all four listboxes, taking several seconds. What I want to do is to create/enable the listboxes in order, so at the user selects from the first listbox, the second is created/enabled, when they select from the second, the third is created/enabled… and so on.

Setting the disabled attribute is no good because the script has already fetched the XML before this is processed.

Any ideas??

Si

UPDATE — Sorry guys, don’t think I made my problem quite clear.

At the top of my script I declare four Spry XML data set variables, each of which goes off (when required) and performs a complex SOAP query against a service, this service then returns a chunk of XML. Each query is dependant on the last, so once the user has selected the type of vehicle, the second data set is refreshed to give an accurate list of manufacturers. When they select the manufacturer, the third list is refreshed to give an accurate list of models for that manufacturer. When they select the model, the list of model derivatives is refreshed for that model (fourth list).

Further down my script I have four SELECT’s, each of which is populated with the data from the spry queries. Now, the user must choose the desired option from each list in turn in order to get the right model in the final box. What I want to do is ONLY populate the first box when the page is generated, then populate (or create??) the second, third and fourth boxes when the user selects the desired value in each, much like happens in the Autotrader website (www.autotrader.co.uk).

As I said in the initial posting, I can’t use the ‘disabled’ attr, or even the jQuery show() and hide() functions, as these do not fire until AFTER all four datasets have been fetched and populated into the SELECT’s. I need something which ideally creates the elements from scratch as and when required, to stop the four lots of XML being fetched at the beginning…

Hope this clarifies

  • 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-14T14:26:21+00:00Added an answer on May 14, 2026 at 2:26 pm
    $('option').click( function() {
        if($(this).val() != 'Select one...'){
            $(this).next('select').attr('enabled', 'enabled');
            $(this).next('select ~ select').attr('disabled', 'disabled');
    
            /* or */
            $(this).after('<!-- Generated select/option HTML -->').nextAll('select').remove();
        }
    }
    

    This is wholly untested, but according to the API, may work. I’m not sure I understand your question completely, but if you’re looking to enable the next option after selection and disable the options after that until the next option is clicked, this is would be your ticket if it works.

    If it’s a matter of adding (or removing) them dynamically, you can just use the .after and .nextAll methods to add and pinpoint select boxes for removal.

    UPDATE: Whoopsie. Had the wrong selectors.

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

Sidebar

Related Questions

I'm using a combination of PHP and Phonegap. I use PHP to build the
I'm using the combination of json_encode (PHP) and JSON.parser (Javascript from json.org) for passing
I am trying to make a search function using the combination of DOM, PHP
I'm using the ajax technique in combination with php and I want to know
I'm using a combination of Paul Duncans php ZipStream ( http://pablotron.org/software/zipstream-php/ ) on the
Is there a way to check a valid host:port combination using regex and php?
I am using jQuery and PHP to write JSON data to my server. I'm
I am currently using a combination of PHP, ORACLE, PDO, and JNDI to connect
I'm building a webapp using Tapestry in combination with Spring Security and the jQuery-library
I am using PHP in combination with Smarty Templates to generate pages serverside. Currently,

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.