Form Builder Software That Writes Cookies Based On User Selections

by 3 replies
4
I have a 10 question multi-choice form.

I would like to display some content and hide other content based on the form responses on the thank you page.

The only way I can imagine doing that is with cookies, then using javascript to display/hide content based on the cookies.

Problem:

I can't find any form builder software that writes cookies for later retrieval.

Anyone know of something like this?
#programming #based #builder #cookies #form #selections #software #user #writes
  • No cookies or Javascript necessary to do that, because all of the form data can be passed via POST to the thankyou page, then you can simply use PHP to echo out the CSS styles to show or hide the div's.

    1) On your form page, just create a form with all of the different questions and answer choices, then submit the form like normal. Form example...

    PHP Tutorial - Forms

    2) Then on the thankyou page (this page should have a .php extension), put a block of PHP code in the <head> section that grabs the submitted data from the previous page, then uses conditional statements to figure out the selected answers to each of your multiple choice questions. Conditional statement example...

    PHP Tutorial - Elseif

    3) Inside each conditional statement, echo out whatever styles you want in order to show / hide div's on that page. For example...

    echo "<style>#DivToHide {visibility: hidden;}</style>";

    You could also use Javascript / jQuery to do this. In fact, if you have a lot of different div's to show/hide, then jQuery would probably be the most efficient method. But the above PHP / CSS example should work just fine.
  • I would also add a display:none to the CSS... just in case
  • Banned
    Form logic can do that in form builders like wufoo or warriorforms.com (check my signature)

Next Topics on Trending Feed