Hi Steph,
Suppose I have a form with three questions. Question 1 gives a choice of A or B. Question 2 gives a choice of C or D.
Is there an easy way to populate Question 3 where the choices are the responses to Questions 1 and 2? For example, if I chose A for question 1 and B for question 2, then question 3 would list A and B, say, in a drop-down.
I don't mind putting the third question on a separate page if that would help, and I don't care if the fields are multiple-choice, checkboxes, or drop-downs–whichever works.
If there is a way, if there a way to specify the default value for the third question?
Thanks




March 7, 2011 at 2:39 am
You can do this, but it requires custom code. Something like this in a new plugin or your theme functions.php would help. This would require you to insert a page break somewhere between question 2 and question 3.
add_filter('frm_setup_new_fields_vars', 'set_custom_select_val', 20, 2); add_filter('frm_setup_edit_fields_vars', 'set_custom_select_val', 20, 2); //the numbers above don't need to be changed. The 20 is the order this filter should be fired. Mine fires at 10, so your must be after that in order to override my categories. The 2 is the number of parameters passed. function set_custom_select_val($values, $field){ if($field->id == 25){ //change 25 to the ID of the drop-down to populate $values['options'][] = $_POST['item_meta'][20] .' and '. $_POST['item_meta'][21]; //change 20 and 21 to the ids for question 1 and question 2 //this adds a new option to this drop-down. } return $values; }March 8, 2011 at 12:28 pm
Thanks Steph!
Topic closed.