I put together a test here:
http://guitar.chrishajer.com/2010/12/02/sentiment-quiz/
Here is the code to put into your theme's functions.php:
http://pastie.org/1342810
You will need to look at the source of the page with your form embedded to determine the field numbers. I put the 15 fields consecutively, and in my form, there are no other fields. So, my starting field is 1 and ending field is 15. If you have any fields before the 15 yes/no questions, then you will have a different starting and ending field number. Adjust those on line 4 and line 5.
Also, to ensure this action runs only on the one form, you should change the form number (7 in my example) on line 14 to your actual form number.
gform_post_submission_7
Change that 7 to your form number.
You can change the text that is echo'd on line 11. I included the entry number just to make sure I was doing it correctly.
I'm not crazy about how the total number of "yes" entries and the confirmation are displayed on the same page, but I think this should get you headed in the right direction.
Posted 13 years ago on Thursday December 2, 2010 |
Permalink