× If you expect answers you should describe your problem and give as much information's as possible. (SQL-Structure, Template Code, Joomla Version ...) Please read this before posting: joodb.feenders.de/support.html

dynamic combo box

More
11 years 5 months ago - 11 years 4 months ago #1227 by adinet
dynamic combo box was created by adinet
Hi Guys, great job with the joodb component. I'm wanting to take it to the next level and create some combo boxes that retrieve data from parent tables. My scenario is:- Parent table "state"is populated with data. (table is called "state" and ). Child table is "district" and and . What I would like to do in form view is enter data in the child table form "district" that corresponds to the state. EG: The state of Tasmania has 3 districts, North, North-West and South. In form view I have 2 fields "district" and "state_id", At the moment in form view I can enter a new district but I need to manually enter the data for "state_id" and need to go to the "state" table to see which state_id number corresponds to the state. What I would like is a combo box that reads the name of the state from the state table that relates to the state_id from the district table. hope it makes sense, P.S. I have the pro version Adi
Last edit: 11 years 4 months ago by joest.

Please Log in to join the conversation.

More
11 years 5 months ago #1238 by Dirk
Replied by Dirk on topic Re: dynamic combo box
Editing of the relations between tables will be implemented in the next version.

If you want the results from your parent table in a select box you might be able to do this by hand with a linked table and a subtemplate.

Example:
<select name="subresults" onchange="doSomething();">
{joodb subtemplate|subselect}
</select>

Your Subtemplate:
<option value="{joodb field|id}">{joodb field|value}</option>

I am not sure if this answers your question.

Please Log in to join the conversation.

Moderators: Dirkjoest