I have a form where the user can dynamically add fields. I want to post these values to PHP to fill in a database table.
Each field can contain other fields that can also be added dynamically (with a button).
The result is a hierarchy of inputs. Example:
My problem is that I don't know how to link each sub-input field to the "main" input fields: b1 and b2 to A1; b3, b4 and b5 to A2 etc.
Shall I use an array and put everything in it ? In this case, how can I know what is the "parent A" of each "b" when I create a new "b" ?
Thank you for your help !!!