Hi,
I'm using multistep and conditional fields to set up a form. All works great when the controlling field and controlled by field are in the same step. I would like to have the controlling field in step 1 and the controlled by fields in the next step, but it doesn't work. I also looked into webform but can not use this module because I want to create views with the data.
Let me explain ... I have +/- 10 different options in the first step. Depending on the choice in the first step, different fields (+/- 15 fields) appear in the second step and in the third step visitors have to fill out fields that are the same for all the options. Is it better to create one content type and work with conditional fields or do you advise to create 10 different content types where I can use some existing fields and fields specific for that form? It is important that I can create a view that combines all the data. I know I can use data from different content types in views, but is it a good idea performance-wise?
I would very much appreciate some good advice or ideas.
Kind regards,
Sfy
Comments
Comment #1
iub98 commentedHi SFY,
I've been battling this problem for some time now. My limited programming knowledge has forced me to expirement with several modules with little success. I'm hoping one of the Drupal experts can give you and I some advice on how to make this work. Now, I'm looking into condtional page redirects or something along that line. I've been going back and fourth with this for some time..
Comment #2
truyenle commented+subscribing
Comment #3
capellicI need this for Drupal 7.
Comment #4
capellicFor those looking for a workaround that, as it turns out, doesn't have a dependency on Conditional Fields but does require code, read on.
Create a module that has an implementation of hook_form_alter(). In that function, you can turn field access off when conditions warrant. In the example below, if the page type is "simple" I want to turn off some fields on step 3. (The step is irrelevant as the code will be run on ever step and make the access decision if it's present.)
In this code snippet, "base" is the name of my module.
Comment #5
xurizaemonYep, setting the element's #access property in hook_form_alter() or equivalent is the way to do this IMO.
What we've done for a 7.x site which has lots of conditional fields on later pages.
Comment #7
aescudier commented@Capelic :
A change that hide (instead not generate) the others steps and that allows "dependents" on other steps than the "dependees" :
in multistep.module , add this in multistep_field_group_pre_render() :
Change :
line 281 :
$prefix = '<div id="multistep-' . $group->group_name . '">';By :