I have a webform where I have fields for 2 contacts where:

  1. Contact A: Individual (Autocomplete)
  2. 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

  1. Go to the webform and see what values are loaded in contact A and contact B fields
  2. Change value in contact A field and see the related value is changed in contact B field as well
  3. 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?


  • What version of webform and webform civicrm are you on?
    – P Joseph
    Oct 2 '20 at 4:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.