Skip Navigation

[Gelöst] Insert form and relationship between three tables

This support ticket is created vor 1 Jahr. There's a good chance that you are reading advice that it now obsolete.

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.

Heute stehen keine Supporter zur Arbeit im Werkzeugsatz-Forum zur Verfügung. Sie können gern Tickets erstellen, die wir bearbeiten werden, sobald wir online sind. Vielen Dank für Ihr Verständnis.

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)

Dieses Thema enthält 1 Antwort, hat 2 Stimmen.

Zuletzt aktualisiert von Waqar vor 1 Jahr.

Assistiert von: Waqar.

Author
Artikel
#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: versteckter Link

Thank you.