I'm using this example code to create a 'add another field' to my custom Form. The form itself is quite big and showing a full example here isn't possible.
The problem I'm having is that when I hit my callback button to 'add another field' the
$form variable is missing most of the form I wish to utilise. My form is an admin area only form, but using the above example works fine in my implementation as POC.
The form utilises vertical_tabs but I have also tried without. I have a lot of validation around this form and in essence it's being built of a yaml file but I can't work out why the form elements are missing during the ajax callback.
$form_state contains all the values submitted by the form including the missing data from
I had assumptions that
#tree was the issue but, I have this set to
TRUE from the start.