Skip to main content
April 27, 2010
Question

List/Menu and dependable subList/subMenu in conditional region ?

  • April 27, 2010
  • 2 replies
  • 1139 views

Hi,

I want to make something like this:

I have a List/Menu populated from a database table named categories.If an item of List/Menu have sub categories then  the subList/Menu must appear in the page(in a conditional region) ,else not appear.The subList/Menu is populated from a database table named subcategories .The subcategories have a foreign key which name is tha same with the primary key of table categories:

Categories (id_cat,name)

subcategories(id_sub,name,id_cat)

Any suggestion   ?

This topic has been closed for replies.

2 replies

April 28, 2010

It is a very good answer ,and i am sure it is for an expert in javascript(the second example) but i am "0" in programing.In case the state have not  cityies ,the second list shoul not appear.The first example (with URL var involves submit butons-not so confortable) .Sorry for my english ,but i thing you are understanding my qustion.

April 27, 2010
Any suggestion   ?

I suggest mentioning the server-side scripting language you plan on using.

The basic process involves creating a recordset for the categories then create another filtered recordset where URL parameter = id. in your menu have links to categories contain a URL parameter id which is passed when clicked to show the sub categories based on the filtered recordset checking against the URL parameter id. Nest your conditional region if URL parameter id isset then show the subcategory else don't show anything.

You can also use a dependent drop-down with spry. Exmple provided. View and study source code.

http://labs.adobe.com/technologies/spry/samples/data_region/DataSetMasterDetailSample.html