Parent and child form

By: Ayman Sheta | Asked: 12/22/2024
ForumsCategory: How-toParent and child form
Ayman Sheta asked 1 month ago
I want to create parent and child form ... Any idea how to link the two form ? Or Any help to that . Thank you Ayman
5 Answers
Rob LeVineRob LeVine answered 1 month ago
Look at repeater fields. If that's not the answer to your question, provide more detail.
Ayman Sheta answered 1 month ago
No , I need to link two form using for example ID field as primary in the Parent form and as secondry in the child form. customer form ..... Address form ..... the customer can have more than one Address ? Thanks Ayman  
Rob LeVineRob LeVine answered 1 month ago
I'm still going to say there's not enough information for me to give you a complete answer so I'll just throw out some thoughts.
  1. In any form you can have a hidden field that stores the id of another entry you want to link it to.
  2. You can investigate embedded forms
  3. For the address example, my suggestion of the repeater fields will still work. You create a repeater and put an address field into it.
Ayman Sheta answered 4 weeks ago
Let me explain more by giving you another Example ... if you have two table in Database customer and Address . I need to link both table , So one customer can have more than one Address . Like linking two table in relation database using a key field in both table . I don't want embedded form . Also using repeater , will not solve the problem . Thank you Ayman
Rob LeVineRob LeVine answered 4 weeks ago
Then my suggestion #1 is what you want. When you create a child entry, use a hook such as frm_setup_new_fields_vars to put the ID of the parent entry into the child's entry. You can also use other hooks, frm_pre_create_entry or frm_after_create_entry. You'll want to note that Formidable entries are not stored relationally, so you have to "fake it".

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right