I have a form with field collections; on form validation I need to add instances of that field collection type. For example, field collection user_data has fields first_name, Last_name; when someone submits the form, I want to add as many fist_name and last_names as I want, programmatically. The field collection user_data is set as unlimited.
I was thinking to something like the following.
// Create new field collection item of type user_data // Set first_name, last_name // Append field collection item to $form some how
I'm just not sure how to do this, or even if it's possible.