I have a webform where I have fields for 2 contacts where:
- Contact A: Individual (Autocomplete)
- Contact B: Employer of Contact A (Static widget)
When I load the contact from url ?cid1=<cid>
the contacts load fine and save as well but the issue is when I try to change the value in Contact A to another contact.
In above case the related contact (Contact B) loads fine but when submitting the webform, the saved value in submission is still the same contact that was loaded in the form as part of the initial form load (When you first visit the webform.
How it works
- Go to the webform and see what values are loaded in
contact A
andcontact B
fields - Change value in
contact A
field and see the related value is changed incontact B
field as well - Submit the webform and see submission, the values selected for
contact B
is not the one that was loaded in step 2 but instead the step 1 values is saved.
Technical Details
I noticed that $form_state['input']
has got correct values but $form_state['values']
only have the default values that were loaded with the webform instead of the ones that we changed.
Note This doesn't happen when the widget is autocomplete. But when you change the field widget to static for contact B, the above issue happens
Please can someone give me some pointers for the above?
Thanks!