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.

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 11 months, 2 weeks 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.

fernandoS-3 confirmed that the issue was resolved on 2023-11-14 22:06:40.
This ticket is now closed. If you're a Toolset client and need related help, please open a new support ticket.