Varying caption and options


Author
Message
raynae
raynae
New Member (29 reputation)New Member (29 reputation)New Member (29 reputation)New Member (29 reputation)New Member (29 reputation)New Member (29 reputation)New Member (29 reputation)New Member (29 reputation)New Member (29 reputation)
Group: Forum Members
Posts: 6, Visits: 40
hello, 
I'm trying to program my captions and response options to vary depending upon an earlier language selection so that I don't have to create separate items (to make later analysis easier).
For caption of radio buttons (for example) I've used this code at the block level:
/onblockbegin = [
if (values.select == "1") radiobuttons.freq1.caption = "Recycling is important";
if (values.select == "2") radiobuttons.freq1.caption = "La raccolta differenziata è importante"; ]

However the same logic doesn't seem to be working for varying option selection:
if(values.select == "1") radiobuttons.freq1.option.1 = "Never";
    if(values.select == "2") radiobuttons.freq1.option.1 = "Mai";
    if(values.select == "1") radiobuttons.freq1.option.2 = "Rarely";
    if(values.select == "2") radiobuttons.freq1.option.2 = "Raramente";
    if(values.select == "1") radiobuttons.freq1.option.3 = "Sometimes";
    if(values.select == "2") radiobuttons.freq1.option.3 = "A Volte";
    if(values.select == "1") radiobuttons.freq1.option.4 = "Often";
    if(values.select == "2") radiobuttons.freq1.option.4 = "Spesso";
    if(values.select == "1") radiobuttons.freq1.option.5 = "Very often";
    if(values.select == "2") radiobuttons.freq1.option.5 = "Molto Spesso";
    if(values.select == "1") radiobuttons.freq1.option.6 = "Not Applicable";
    if(values.select == "2") radiobuttons.freq1.option.6 = "Non Applicable";
Do you have any suggestions?


Dave
Dave
Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)Supreme Being (929K reputation)
Group: Administrators
Posts: 11K, Visits: 68K
raynae - 4/26/2021
hello, 
I'm trying to program my captions and response options to vary depending upon an earlier language selection so that I don't have to create separate items (to make later analysis easier).
For caption of radio buttons (for example) I've used this code at the block level:
/onblockbegin = [
if (values.select == "1") radiobuttons.freq1.caption = "Recycling is important";
if (values.select == "2") radiobuttons.freq1.caption = "La raccolta differenziata è importante"; ]

However the same logic doesn't seem to be working for varying option selection:
if(values.select == "1") radiobuttons.freq1.option.1 = "Never";
    if(values.select == "2") radiobuttons.freq1.option.1 = "Mai";
    if(values.select == "1") radiobuttons.freq1.option.2 = "Rarely";
    if(values.select == "2") radiobuttons.freq1.option.2 = "Raramente";
    if(values.select == "1") radiobuttons.freq1.option.3 = "Sometimes";
    if(values.select == "2") radiobuttons.freq1.option.3 = "A Volte";
    if(values.select == "1") radiobuttons.freq1.option.4 = "Often";
    if(values.select == "2") radiobuttons.freq1.option.4 = "Spesso";
    if(values.select == "1") radiobuttons.freq1.option.5 = "Very often";
    if(values.select == "2") radiobuttons.freq1.option.5 = "Molto Spesso";
    if(values.select == "1") radiobuttons.freq1.option.6 = "Not Applicable";
    if(values.select == "2") radiobuttons.freq1.option.6 = "Non Applicable";
Do you have any suggestions?


Use values.

<values>
/ select = 2
/ option1 = " "
/ option2 = " "
/ option3 = " "
/ option4 = " "
/ option5 = " "
/ option6 = " "
</values>


<surveypage mypage>
/ ontrialbegin = [
    if (values.select == 1) {
        values.option1 = "Never";
        values.option2 = "Rarely";
        values.option3 = "Sometimes";
        values.option4 = "Often";
        values.option5 = "Very Often";
        values.option6 = "Not Applicable";
    } else if (values.select == 2){
        values.option1 = "Mai";
        values.option2 = "Raramente";
        values.option3 = "A Volte";
        values.option4 = "Spesso";
        values.option5 = "Molto Spesso";
        values.option6 = "Non Applicable";
    }
]
/ questions = [1=freq1]
</surveypage>

<radiobuttons freq1>
/ options = ("<%values.option1%>", "<%values.option2%>", "<%values.option3%>", "<%values.option4%>", "<%values.option5%>", "<%values.option6%>")
</radiobuttons>


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search