Skip Navigation

[Resolved] Insert form and relationship between three tables

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 1 reply, has 2 voices.

Last updated by Waqar 1 year ago.

Assisted by: Waqar.

Author
Posts
#2661273

Hi!

I have three tables: brands, models, bikes.
- brands 1 to many models
- models 1 to many bikes

Relationship is easy to do, but I'm not finding a way to do it in a single form.

What I would like is: in the motorcycle insertion/editing form, choose the brand (popup field) and then list only the models (popup field) of the brand chosen in the brand field.

Is it possible to do this in a single form?

Thank you!

#2661375

Hi,

Thank you for contacting us and I'd be happy to assist.

Your observation is correct and a single Toolset form can only be used to connect with 1 level of immediate parent related post.

For example, if it is a form to add/edit a bike/motorcycle, it can include the field to select the parent 'model'. But there is no option to also select another level parent 'brand'.

One way to overcome this would be to include the name of the brand in the titles of the model posts too.
( e.g. instead of saving a model title as 'CD-100', you can save it as 'Honda - CD 100')

This will make it easier to recognize and associate the models with the brands.

regards,
Waqar

#2664811

I decide connect brands with bikes too and use hook, PHP and JS on forms to build other way.

The public result: hidden link

Thank you.