473,395 Members | 1,730 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Creating a category tree

Hello all,

I am working on a website for a bookstore and have run into a bit of a snag.
I am trying to write a form where an admin can set the category for a book.
However, categories can be of an arbitrary depth so I need something which
resembles a windows "tree view." For example:

Primary category Art and Architecture
has subcategory history
has subcategory African etc etc.

I can't say in advance how deep the tree will go so don't know how many
select boxes to place on the form. Are there any examples out there of a
similar construction I can learn from. Though I do know html/cgi, I'm no
JavaScript/dhtml expert which I assume this will involve. From the
backend's point of view, the page would probably have to, when a category
was selected, query the server which would return any subcategories, that
part is simple enough. It's the frontend I am not sure of.

Thanks,
Shane
Sep 27 '05 #1
2 4444
sh***************************@cm.nu wrote:
Hello all,

I am working on a website for a bookstore and have run into a bit of a snag.
I am trying to write a form where an admin can set the category for a book.
However, categories can be of an arbitrary depth so I need something which
resembles a windows "tree view." For example:

Primary category Art and Architecture
has subcategory history
has subcategory African etc etc.

I can't say in advance how deep the tree will go so don't know how many
select boxes to place on the form. Are there any examples out there of a
similar construction I can learn from. Though I do know html/cgi, I'm no
JavaScript/dhtml expert which I assume this will involve. From the
backend's point of view, the page would probably have to, when a category
was selected, query the server which would return any subcategories, that
part is simple enough. It's the frontend I am not sure of.


Try >>>-- comp.lang.javascript -->

In the meantime, you may want to have a look at how your thesaurus might
be delivered - for example, when "Art and Architecture" are selected,
fill a second select with all the sub-categories including 'history',
which when selected creates a third select with the categories with
'african', etc.

There is an article on XMLHttpRequest here:

<URL:http://developer.apple.com/internet/webcontent/xmlhttpreq.html>
And a cross-browser example here:

<URL:http://developer.apple.com/internet/webcontent/XMLHttpRequestExample/example.html>
--
Rob
Sep 27 '05 #2
sh***************************@cm.nu wrote:

I can't say in advance how deep the tree will go so don't know how many
select boxes to place on the form. Are there any examples out there of a
similar construction I can learn from. [...]

Server-side programs like PHP, JSP, ASP and even perl are often used to
create dynamically generated pages. CGI is less common because it's
noticeably more difficult to use.
Web commerce/shopping programs often have support for categories.
Search for some that make the source code available.

--
jmm dash list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Sep 27 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Brian Murphy | last post by:
<?php /* I need your help. I'd be very thankfull if write me this script.I need a script that displays a list of categories and subcategories like this: <select name="category"> <option...
2
by: Troy Lynch | last post by:
I'm looking into writing a Category Hierarchy on a site I've written and am looking for some information about writing this kind of code. Maybe some samples or a book. Any information would be...
1
by: Ted | last post by:
I am currently putting together an eCommerce site. I have almost everything in place, but I am not happy with the category system for our products. There are around 2500 products in a SQL Sever...
5
by: Travis Pupkin | last post by:
Hey, I've done a number of product catalogs/galleries with one or two category levels (Category > Subcategory). The straightforward way to do this, of course, is to use database fields for...
2
by: RottNKorpse | last post by:
Well I am trying to make an admin section to allow my other admins of my site able to add content to my mysql database without giving them phpmyadmin access and without teaching them out to use it as...
24
by: Phil Latio | last post by:
Let's say I have a simple web application running with just two MySQL tables. The tables structure is as follows: Table: category category_id (PK) category_name parent_category (FK)...
1
by: shmodi | last post by:
Hi All, I am new here and want to get some help for speeding up and resolving IE issue while creating tree using ajax. My tree contains radio buttons at each level and I am getting all tree...
2
by: astolpho | last post by:
I am using a slightly outdated reference book on J2EE programming. It gives 2 methods of creating a database used in its casestudies. The first is an ANT script that gives the following output: ...
2
by: slizorn | last post by:
hi guys, i need to make a tree traversal algorithm that would help me search the tree.. creating a method to search a tree to find the position of node and to return its pointer value basically i...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.