[Solved] Can I set the status of a checkbox option to be checked based on a hidden variable?

0

Hi,
I am passing in some URL variables and storing them as hidden values on page 1 of my survey. So I might have:

surveylink?&pid=1234&option1=true&option2=false&option3=true

 

I want to be able to prepopulate the answers to a checkbox question so that option1 & option3 would be checked and option2 would be unchecked.

Is there an easy way to do this – I cannot seem to get it to check the box using a logic condition using the hidden variable.

 

Thank you in advance for any assistance.

Steve

SurveyMasterinTraining selected answer

    Best answer

    0

    Hi Dominic,
    Thank you for the response. It does not seem to be working for me at the moment – I  am probably missing something obvious and just cannot see for looking right now :)

    I will put together some more info about how my survey is set up and post it if I cannot get it to work.

    Is there a particular value I need to assign in my hidden variable to set the checkbox as checked (is it true, checked, 1 etc?) 

    Thanks

    Steve

    SurveyMasterinTraining selected as best answer
      • The value of the hidden variables needs to exactly match the reporting value of the answer option in the checkbox question.

        For example, if your checkbox question has answer options of apple, orange, and banana – the hidden variable would need to say ‘apple’ in order for apple to be selected in the checkbox (via the default answer field). This article could be a good reference:

        https://help.surveygizmo.com/help/using-url-variables-in-surveys

        Hope this helps!

      • That is perfect! I had gone down the traditional routes of true,checked,1 etc.

        Thank you for your assistance.

      0

      You will probably want to use the Default Answer option described here:

      https://help.surveygizmo.com/help/preselect-answer-option

      You could reference the Hidden Value (via merge code) in the default answer field. Keep in mind that the checkbox question would need to be on a page after the Hidden Value. Also, because you are wanting to select multiple options in the checkbox, these will need to be comma separated.

      So in your Default Answer field in the checkbox question, this should probably look something like this:

      [question(“value”), id=”1″],[question(“value”), id=”2″] (these are just example merge codes but should be separated by a comma and no spaces.

      Hope this helps you get going!

      Dominic Sharpe answered
        ×

        Login

        Question stats

        • Active
        • Views5523 times
        • Answers2 answers
        • Followers1 follower