Skip Navigation

[Résolu] Insert form and relationship between three tables

This support ticket is created Il y a 1 année. 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.

Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.

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)

Ce sujet contient 1 réponse, a 2 voix.

Dernière mise à jour par Waqar Il y a 1 année.

Assisté par: Waqar.

Auteur
Publications
#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: lien caché

Thank you.