Populate radio field with list in hidden field

By: Luke Zinn | Asked: 07/19/2022
ForumsCategory: Code HelpPopulate radio field with list in hidden field
Luke Zinn asked 2 years ago
I would like to populate a radio field with the data from a hidden field. Here is what I am planning to do:
  1. User chooses 14 items from a checkbox field on Form #1. User submits form and it sends user to Form #2.
  2. Form #2 has a hidden field that is populated with checkbox choices in Form #1. Form #2 also has a radio field that I would like to populate with all the items listed in the hidden field. The user selects one of the options and submits the form, and then it sends the user to Form #3.
  3. Form #3 has a hidden field that is populated with checkbox choices in Form #1, MINUS the option chosen in the radio field from Form #2. Form #3 also has a radio field with the remaining 13 items. User selects radio field and submits Form #3.
  4. After form is submitted, I would like to show the 2 items selected from the radio fields in Form #2 and Form #3.
  I have been able to get Form #1 to send the data submitted to Form #2 based on this documentation, but I am unsure how to remove options as the user selects them in the radio buttons. Alternatively, I could send the choices from Form #1 directly to the radio field in Form #2, and then use this method to remove any options already selected in the radio field.   Would love to hear what others think about this. I'm on a tight deadline and would appreciate any insight anyone has to offer. Thanks!!
Bobby Clapp replied 2 years ago

Does this require a logged in user or is it open to anyone who fills out the form from a public page? Will the user filling out the form be able to submit more than one entry?

Luke Zinn replied 2 years ago

It does not require the user to be logged in, but we can definitely make that required if it helps. We are open to the user being able to submit more than one entry but it is not required.

Bobby Clapp replied 2 years ago

This is going to take some custom code applied to a version of this -> https://formidableforms.com/knowledgebase/frm_setup_new_fields_vars/#kb-replace-field-options

You're going to have to get all of the values selected in form one, specific to the entry ID (or via the hidden field in form 2), and then dynamically populate the values inside the next level form field from the array taken from the hidden field or database values of the "parent" field from the previous form.

That's the only way I can wrap my head around it currently.

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right