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
- Change value in
contact Afield and see the related value is changed in
contact Bfield as well
- Submit the webform and see submission, the values selected for
contact Bis not the one that was loaded in step 2 but instead the step 1 values is saved.
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?