questionnaire 1

Show fields one by one and hide completed fields

This example shows how you can use Conditional Fields for Contact Form 7 to create a form that will force the user to fill in fields in a particular order by only displaying the next field if the previous field is filled out. In this example the fields disappear after they are filled, and then display a new field. In some cases you might want all fields to remain visible and editable after they are filled out. This can also be achieved with CF7CF. An example of this is questionnaire 2.

Form

Question 1: Hi, how are you?
Question 2: What is your favorite color?
Question 3: What is your least favorite color?
Question 4: Do you like my website?
Question 5: Do you like this plugin?
Question 6: Do you like random questions?
Question 7: How the hell are you supposed to answer this question?
Question 8: Wow! You made it pretty far already, seems like you really enjoy filling out this questionnaire, don't you?
Question 9: One more question after this one. Okay?
Question 10: Just answer yes or no and the submit button will appear!

 

Form Code

[group g1]
Question 1: Hi, how are you?
[select q1 "---" "I'm great" "I'm fine" "Not so well"]
[/group]

[group g2][group g2sub]
Question 2: What is your favorite color?
[select q2 "---" "red" "blue" "yellow" "something else"]
[/group][/group]

[group g3][group g3sub]
Question 3: What is your least favorite color?
[select q3 "---" "red" "blue" "yellow" "something else"]
[/group][/group]

[group g4][group g4sub]
Question 4: Do you like my website?
[select q4 "---" "yes" "no"]
[/group][/group]

[group g5][group g5sub]
Question 5: Do you like this plugin?
[select q5 "---" "yes" "no"]
[/group][/group]

[group g6][group g6sub]
Question 6: Do you like random questions?
[select q6 "---" "yes" "no"]
[/group][/group]

[group g7][group g7sub]
Question 7: How the hell are you supposed to answer this question?
[select q7 "---" "yes" "no"]
[/group][/group]

[group g8][group g8sub]
Question 8: Wow! You made it pretty far already, seems like you really enjoy filling out this questionnaire, don't you?
[select q8 "---" "yes" "no"]
[/group][/group]

[group g9][group g9sub]
Question 9: One more question after this one. Okay?
[select q9 "---" "yes" "no"]
[/group][/group]

[group g10][group g10sub]
Question 10: Just answer yes or no and the submit button will appear!
[select q10 "---" "yes" "no"]
[/group][/group]

[group gsubmit]
[submit]
[/group]
<p>&nbsp;</p>

Email Code

q1: [q1]
q2: [q2]
q3: [q3]
q4: [q4]
q5: [q5]
q6: [q6]
q7: [q7]
q8: [q8]
q9: [q9]
q10: [q10]

Conditional Fields

show group if field operator value

g1 g2 g2sub g3 g3sub g4 g4sub g5 g5sub g6 g6sub g7 g7sub g8 g8sub g9 g9sub g10 g10sub gsubmit