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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T03:05:54+00:00 2026-06-08T03:05:54+00:00

I’m looking for some example code, if any exists to handle the scenario below.

  • 0

I’m looking for some example code, if any exists to handle the scenario below.

I would like to make some cascading (filtering) selected boxes like ebay.com uses when you add a new item.

I’m having difficulties because

  1. There can be many parent-child relationships. There can exists categories with four or more sub categories.
  2. I’m not sure if I should add select boxes dynamically though jquery when someone clicks on a parent category, or have many hidden selected boxes on the page and hide/show as needed.
  3. I’m sure I could look this up, but I’m not sure yet how to use form elements dynamically added though javascript in the code behind.

Does anyone know how eBay does it?

Data would be like this:

Coins US -> Dollars -> Morgan -> 1894-98

or

Stamps -> US -> Covers -> FDC -> 1931-1940

The data will be stored in a sql table with the structure:

Id | CategoryText | ParentId

Each level selected in the tree would result in a new select box to the right of it being generated with the available child values.

  • 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-06-08T03:05:57+00:00Added an answer on June 8, 2026 at 3:05 am

    Looks like I’m posting my own answer to my first question.

    Here’s a general outline of what I’m going to do, I haven’t coded it up yet but I spent the evening thinking though the solution and believe it will work.

    1. De-normalize the data. Instead of having the data in the format of

      Id | CategoryText | ParentId

      I’ll store things as

      Id | CategoryTextLevel1 | CategoryTextLevel2 ect.

      I did some research and saw at this point in time ebay’s category structure only goes down six levels and that will work for me aswell I believe.

    2. On page load, call service to get first level of categories.

    3. Attach event handler to each select box item, not sure how I’ll do this yet but I think I might be able to just have one globally on option.click()

    4. Select box items will be stored in the format <option id="x_y" value="y" where x is the level of category (1-6) and y is the category Id in the database

    5. On Option click

      1. Loop though select boxes 1-6 and remove if id is greater then the index of the item we clicked on

      2. Loop through all selected options on the page. If we’re at a leaf node, enable save/continue button and show summary of selected category chain.

    I still have some stuff to figure out like when/how to bind all the events in jquery but this is the basic outline I’ll use to code the page.

    Also, even though I’m posting an answer. If anyone else has something similiar coded up on their site, feel free to post a link so I can compare with my implementation 🙂

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

Sidebar

Related Questions

I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I would like to run a str_replace or preg_replace which looks for certain words
I have some data like this: 1 2 3 4 5 9 2 6
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I have two tables with like below codes: Table: Accounts id | username |
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i

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.