This topic is locked

Three dependent dropdowns

12/20/2008 4:00:18 PM
PHPRunner General questions
M
mengo author

Hi,

I want to build three dependent dropdowns. For example: 1st: product type --> food 2nd: foodtype --> burger 3rd: burger contents(cheese, beef)

So, could anyone help me in this issue. I'm can do two dependent dropdowns, but couldn't do three...

Plz help....

J
Jane 12/22/2008

Hi,
you can post structure of your tables here and I'll try to help you.

M
mengo author 12/22/2008

Hi,

you can post structure of your tables here and I'll try to help you.


Hi Jane,

Thanks for your reply.

Actually I don't have ready tables yet. I'm not developing something related with food. It was just for explanation.
So, may be this example about computer manufacturer's support site can explain better.

1st Dropdown - Products Select:(say I selected notebooks)

Desktops

Notebooks

Projectors

Accessories

2nd Dropdown - Series Select:(say I selected Portege)

Qosmio

Satellite

Portege

3rd Dropdown - Model Numbers Select:(say I selected S100)

S100

M200

M400

...
So, this is what I mean when I say three dependent dropdowns. I hope I was explicit enough to explain my problem.

Waiting for your reply...
Regards,

J
Jane 12/23/2008

Hi,
just add linked fields to the tables used as lookup tables.

Products

ProductID ProductName
Series

SeriesID SeriesName ProductID
Model

ModelID ModelName SeriesID

M
mengo author 12/24/2008

Hi,

just add linked fields to the tables used as lookup tables.

Products

ProductID ProductName
Series

SeriesID SeriesName ProductID
Model

ModelID ModelName SeriesID


Hi Jane,

You are fantastic.

I sorted out my problem.

Now, could you in with this issue?
How can I assign default values to certain users/user groups regarding first dropdown?

I mean if user1 is logged then certain product is selected in products dropdown.
Thanks in advance

Merry Christmas.

J
Jane 12/24/2008

Hi,
just add where clause for your first dropdown on the "Edit as" settings dialog on the Visual Editor tab.

Username of current user is in the $_SESSION["UserID"] variable.

M
mengo author 12/30/2008

Hi,

just add where clause for your first dropdown on the "Edit as" settings dialog on the Visual Editor tab.

Username of current user is in the $_SESSION["UserID"] variable.


Jane,

so, if I would like to set default value/default selected from for user called "user1"...

I get confused...

for user "user1" default value(default selected) should be Desktops from products dropdown

for user "user2" default value(default selected) should be Notebooks from products dropdown

for user "user3" default value(default selected) should be ...... from products dropdown
How should it work?
Thanks in advance
Happy New Year

J
Jane 1/5/2009

Hi,
to set up default value select it from lookup table in the Add page: Before process event, then save it in the session variable.

Use this session variable as default value on the "Edit as" settings dialog on the Visual Editor tab.