Checkbox values post to thank you page

  • StrategicOS
    Asked on January 12, 2016 at 12:31 PM

    How do I write the request so that I can get the values into variables for my use?  I am setting up a form that depending on the values selected (and it can be multiple) values, it will show certain parts of another form (prepopulated).  I know how to do the second part but I'm having problems with the check boxes in particular. 

    I've done this so far for q4_choose

    $obj = $_POST;

    $var= $obj[choose[]];

    $var= $obj[q4_choose];

    $var= $obj[choose];

    $var= $obj[choose][0];

     $var= $obj[choose][];

    and also tried a few while within ''s 

    while also doing 

    echo $var; //just in case it comes as a string

    print_r($var); //in case it's an array

    to see if it's working.  Nothing is working here.  

  • Charlie
    Replied on January 12, 2016 at 3:16 PM

    I tried this one and it seems to work:

    <?php

    $choose = $_POST['choose'];

    foreach($choose as $result) {

        echo $result, '<br>';

    }

    ?>

     

    You can check my cloned form here: https://form.jotform.com/60115484846963 

    Basically, I followed this guide: http://www.jotform.com/help/51-How-to-Post-Submission-Data-to-Thank-You-Page. From there, I can check the POST PHP variables that I can use. The check boxes are stored in an array so I need to check using foreach and output it one by one.

    Let us know if you need more help on that.