Millisecond Forums

Displaying text that varies with the clicked radiobutton (in real time)

https://forums.millisecond.com/Topic40849.aspx

By EN - 6/17/2025

Hello:

I wonder if it is possible to display some text that varies depending on the clicked radiobutton, on the same screen with the radiobuttons?
The text should be changed in real time, that is, if the subject clicks another radiobutton, the text should change accordingly.

The sample code below is where I'm standing right now. I am able to detect the radiobutton that was clicked _before_ the user pressed "continue" and display the corresponding text on the next screen. I would like to merge those two screens.

Any help will be greatly appreciated. Thank you very much in advance!
EN
--
<survey SOV_explain_survey>
/pages = [1=SOV_explain]
</survey>

<surveypage SOV_explain>
/caption = "EXPLANATION ABOUT buttons of radiobuttons"
/questions = [1-1=sequence(SOV_item1)]
/ itemfontstyle = ("Arial", 2.00%, false, false, false, false, 5, 1)
/ itemspacing = 0.0%
/ showpagenumbers = false
/ showbackbutton = false
/ showquestionnumbers = false
/ responsefontstyle = ("Arial", 2.0%, false, false, false, false, 5, 1)
</surveypage>

<radiobuttons SOV_item1>
/ caption="<b>SOV item 1 </b>"
/ options=("<b>自分</b>:85<br><b>相手</b>:85", ":85<br>:76", ":85<br>:68", ":85<br>:59", ":85<br>:50", ":85<br>:41", ":85<br>:33", ":85<br>:24", ":85<br>:15")
/ optionvalues = ("1", "2", "3", "4","5", "6", "7", "8", "9")
/ required = true
/ orientation = horizontalequal
/ defaultResponse = 5
</radiobuttons>

<text myText1>
// items= ("You chose = <% radiobuttons.SOV_item1.selectedValue %>")
/ items = test_SOV_choice1
/ select = radiobuttons.SOV_item1.selectedValue
</text>

<trial showText1>
/stimulusFrames = [1=myText1]
///stimulusFrames = [1=SOV_explain; 2=myText1]
/timeout = 5000
</trial>

<block wrap_showText1>
/trials=[1=showText1]    
</block>

///

<item test_SOV_choice1>
/ 1="自分の取り分は85、相手の取り分は85 --> <% radiobuttons.SOV_item1.selectedValue %>"
/ 2="自分の取り分は85、相手の取り分は76 --> <% radiobuttons.SOV_item1.selectedValue %>"
/ 3="自分の取り分は85、相手の取り分は68 --> <% radiobuttons.SOV_item1.selectedValue %>"
/ 4="自分の取り分は85、相手の取り分は59 --> <% radiobuttons.SOV_item1.selectedValue %>"
/ 5="自分の取り分は85、相手の取り分は50 --> <% radiobuttons.SOV_item1.selectedValue %>"
/ 6="自分の取り分は85、相手の取り分は41 --> <% radiobuttons.SOV_item1.selectedValue %>"
/ 7="自分の取り分は85、相手の取り分は33 --> <% radiobuttons.SOV_item1.selectedValue %>"
/ 8="自分の取り分は85、相手の取り分は24 --> <% radiobuttons.SOV_item1.selectedValue %>"
/ 9="自分の取り分は85、相手の取り分は15 --> <% radiobuttons.SOV_item1.selectedValue %>"
</item>

///
By Dave - 6/17/2025

EN - 6/17/2025
Hello:

I wonder if it is possible to display some text that varies depending on the clicked radiobutton, on the same screen with the radiobuttons?
The text should be changed in real time, that is, if the subject clicks another radiobutton, the text should change accordingly.

The sample code below is where I'm standing right now. I am able to detect the radiobutton that was clicked _before_ the user pressed "continue" and display the corresponding text on the next screen. I would like to merge those two screens.

Any help will be greatly appreciated. Thank you very much in advance!
EN
--
<survey SOV_explain_survey>
/pages = [1=SOV_explain]
</survey>

<surveypage SOV_explain>
/caption = "EXPLANATION ABOUT buttons of radiobuttons"
/questions = [1-1=sequence(SOV_item1)]
/ itemfontstyle = ("Arial", 2.00%, false, false, false, false, 5, 1)
/ itemspacing = 0.0%
/ showpagenumbers = false
/ showbackbutton = false
/ showquestionnumbers = false
/ responsefontstyle = ("Arial", 2.0%, false, false, false, false, 5, 1)
</surveypage>

<radiobuttons SOV_item1>
/ caption="<b>SOV item 1 </b>"
/ options=("<b>自分</b>:85<br><b>相手</b>:85", ":85<br>:76", ":85<br>:68", ":85<br>:59", ":85<br>:50", ":85<br>:41", ":85<br>:33", ":85<br>:24", ":85<br>:15")
/ optionvalues = ("1", "2", "3", "4","5", "6", "7", "8", "9")
/ required = true
/ orientation = horizontalequal
/ defaultResponse = 5
</radiobuttons>

<text myText1>
// items= ("You chose = <% radiobuttons.SOV_item1.selectedValue %>")
/ items = test_SOV_choice1
/ select = radiobuttons.SOV_item1.selectedValue
</text>

<trial showText1>
/stimulusFrames = [1=myText1]
///stimulusFrames = [1=SOV_explain; 2=myText1]
/timeout = 5000
</trial>

<block wrap_showText1>
/trials=[1=showText1]    
</block>

///

<item test_SOV_choice1>
/ 1="自分の取り分は85、相手の取り分は85 --> <% radiobuttons.SOV_item1.selectedValue %>"
/ 2="自分の取り分は85、相手の取り分は76 --> <% radiobuttons.SOV_item1.selectedValue %>"
/ 3="自分の取り分は85、相手の取り分は68 --> <% radiobuttons.SOV_item1.selectedValue %>"
/ 4="自分の取り分は85、相手の取り分は59 --> <% radiobuttons.SOV_item1.selectedValue %>"
/ 5="自分の取り分は85、相手の取り分は50 --> <% radiobuttons.SOV_item1.selectedValue %>"
/ 6="自分の取り分は85、相手の取り分は41 --> <% radiobuttons.SOV_item1.selectedValue %>"
/ 7="自分の取り分は85、相手の取り分は33 --> <% radiobuttons.SOV_item1.selectedValue %>"
/ 8="自分の取り分は85、相手の取り分は24 --> <% radiobuttons.SOV_item1.selectedValue %>"
/ 9="自分の取り分は85、相手の取り分は15 --> <% radiobuttons.SOV_item1.selectedValue %>"
</item>

///

No, it's not possible to display that information in real-time on the same page. You can only display it after the page has been submitted, on a different page.
By EN - 6/17/2025

Dave - 6/17/2025
EN - 6/17/2025
Hello:

I wonder if it is possible to display some text that varies depending on the clicked radiobutton, on the same screen with the radiobuttons?
The text should be changed in real time, that is, if the subject clicks another radiobutton, the text should change accordingly.

The sample code below is where I'm standing right now. I am able to detect the radiobutton that was clicked _before_ the user pressed "continue" and display the corresponding text on the next screen. I would like to merge those two screens.

Any help will be greatly appreciated. Thank you very much in advance!
EN
--
<survey SOV_explain_survey>
/pages = [1=SOV_explain]
</survey>

<surveypage SOV_explain>
/caption = "EXPLANATION ABOUT buttons of radiobuttons"
/questions = [1-1=sequence(SOV_item1)]
/ itemfontstyle = ("Arial", 2.00%, false, false, false, false, 5, 1)
/ itemspacing = 0.0%
/ showpagenumbers = false
/ showbackbutton = false
/ showquestionnumbers = false
/ responsefontstyle = ("Arial", 2.0%, false, false, false, false, 5, 1)
</surveypage>

<radiobuttons SOV_item1>
/ caption="<b>SOV item 1 </b>"
/ options=("<b>自分</b>:85<br><b>相手</b>:85", ":85<br>:76", ":85<br>:68", ":85<br>:59", ":85<br>:50", ":85<br>:41", ":85<br>:33", ":85<br>:24", ":85<br>:15")
/ optionvalues = ("1", "2", "3", "4","5", "6", "7", "8", "9")
/ required = true
/ orientation = horizontalequal
/ defaultResponse = 5
</radiobuttons>

<text myText1>
// items= ("You chose = <% radiobuttons.SOV_item1.selectedValue %>")
/ items = test_SOV_choice1
/ select = radiobuttons.SOV_item1.selectedValue
</text>

<trial showText1>
/stimulusFrames = [1=myText1]
///stimulusFrames = [1=SOV_explain; 2=myText1]
/timeout = 5000
</trial>

<block wrap_showText1>
/trials=[1=showText1]    
</block>

///

<item test_SOV_choice1>
/ 1="自分の取り分は85、相手の取り分は85 --> <% radiobuttons.SOV_item1.selectedValue %>"
/ 2="自分の取り分は85、相手の取り分は76 --> <% radiobuttons.SOV_item1.selectedValue %>"
/ 3="自分の取り分は85、相手の取り分は68 --> <% radiobuttons.SOV_item1.selectedValue %>"
/ 4="自分の取り分は85、相手の取り分は59 --> <% radiobuttons.SOV_item1.selectedValue %>"
/ 5="自分の取り分は85、相手の取り分は50 --> <% radiobuttons.SOV_item1.selectedValue %>"
/ 6="自分の取り分は85、相手の取り分は41 --> <% radiobuttons.SOV_item1.selectedValue %>"
/ 7="自分の取り分は85、相手の取り分は33 --> <% radiobuttons.SOV_item1.selectedValue %>"
/ 8="自分の取り分は85、相手の取り分は24 --> <% radiobuttons.SOV_item1.selectedValue %>"
/ 9="自分の取り分は85、相手の取り分は15 --> <% radiobuttons.SOV_item1.selectedValue %>"
</item>

///

No, it's not possible to display that information in real-time on the same page. You can only display it after the page has been submitted, on a different page.

Thanks, Dave!
On a related topic, is it possible to display a radiobuttons with /defaultResponse set to an arbitrary and fixed button (like, mouse clicks on radiobuttons are disabled and participants _cannot_ click on a different button?
I would like to use such a fixed radiobuttons to explain the meaning of a choice, before they get to actually make selection in subsequent trials.
Best,
EN
By Dave - 6/18/2025

EN - 6/18/2025
Dave - 6/17/2025
EN - 6/17/2025
Hello:

I wonder if it is possible to display some text that varies depending on the clicked radiobutton, on the same screen with the radiobuttons?
The text should be changed in real time, that is, if the subject clicks another radiobutton, the text should change accordingly.

The sample code below is where I'm standing right now. I am able to detect the radiobutton that was clicked _before_ the user pressed "continue" and display the corresponding text on the next screen. I would like to merge those two screens.

Any help will be greatly appreciated. Thank you very much in advance!
EN
--
<survey SOV_explain_survey>
/pages = [1=SOV_explain]
</survey>

<surveypage SOV_explain>
/caption = "EXPLANATION ABOUT buttons of radiobuttons"
/questions = [1-1=sequence(SOV_item1)]
/ itemfontstyle = ("Arial", 2.00%, false, false, false, false, 5, 1)
/ itemspacing = 0.0%
/ showpagenumbers = false
/ showbackbutton = false
/ showquestionnumbers = false
/ responsefontstyle = ("Arial", 2.0%, false, false, false, false, 5, 1)
</surveypage>

<radiobuttons SOV_item1>
/ caption="<b>SOV item 1 </b>"
/ options=("<b>自分</b>:85<br><b>相手</b>:85", ":85<br>:76", ":85<br>:68", ":85<br>:59", ":85<br>:50", ":85<br>:41", ":85<br>:33", ":85<br>:24", ":85<br>:15")
/ optionvalues = ("1", "2", "3", "4","5", "6", "7", "8", "9")
/ required = true
/ orientation = horizontalequal
/ defaultResponse = 5
</radiobuttons>

<text myText1>
// items= ("You chose = <% radiobuttons.SOV_item1.selectedValue %>")
/ items = test_SOV_choice1
/ select = radiobuttons.SOV_item1.selectedValue
</text>

<trial showText1>
/stimulusFrames = [1=myText1]
///stimulusFrames = [1=SOV_explain; 2=myText1]
/timeout = 5000
</trial>

<block wrap_showText1>
/trials=[1=showText1]    
</block>

///

<item test_SOV_choice1>
/ 1="自分の取り分は85、相手の取り分は85 --> <% radiobuttons.SOV_item1.selectedValue %>"
/ 2="自分の取り分は85、相手の取り分は76 --> <% radiobuttons.SOV_item1.selectedValue %>"
/ 3="自分の取り分は85、相手の取り分は68 --> <% radiobuttons.SOV_item1.selectedValue %>"
/ 4="自分の取り分は85、相手の取り分は59 --> <% radiobuttons.SOV_item1.selectedValue %>"
/ 5="自分の取り分は85、相手の取り分は50 --> <% radiobuttons.SOV_item1.selectedValue %>"
/ 6="自分の取り分は85、相手の取り分は41 --> <% radiobuttons.SOV_item1.selectedValue %>"
/ 7="自分の取り分は85、相手の取り分は33 --> <% radiobuttons.SOV_item1.selectedValue %>"
/ 8="自分の取り分は85、相手の取り分は24 --> <% radiobuttons.SOV_item1.selectedValue %>"
/ 9="自分の取り分は85、相手の取り分は15 --> <% radiobuttons.SOV_item1.selectedValue %>"
</item>

///

No, it's not possible to display that information in real-time on the same page. You can only display it after the page has been submitted, on a different page.

Thanks, Dave!
On a related topic, is it possible to display a radiobuttons with /defaultResponse set to an arbitrary and fixed button (like, mouse clicks on radiobuttons are disabled and participants _cannot_ click on a different button?
I would like to use such a fixed radiobuttons to explain the meaning of a choice, before they get to actually make selection in subsequent trials.
Best,
EN

You can set to an arbitrary default response, but there is no way to prevent participants from changing it. Disabling clicks is not possible.
By EN - 6/18/2025

Dave - 6/18/2025
EN - 6/18/2025
Dave - 6/17/2025
EN - 6/17/2025
Hello:

I wonder if it is possible to display some text that varies depending on the clicked radiobutton, on the same screen with the radiobuttons?
The text should be changed in real time, that is, if the subject clicks another radiobutton, the text should change accordingly.

The sample code below is where I'm standing right now. I am able to detect the radiobutton that was clicked _before_ the user pressed "continue" and display the corresponding text on the next screen. I would like to merge those two screens.

Any help will be greatly appreciated. Thank you very much in advance!
EN
--
<survey SOV_explain_survey>
/pages = [1=SOV_explain]
</survey>

<surveypage SOV_explain>
/caption = "EXPLANATION ABOUT buttons of radiobuttons"
/questions = [1-1=sequence(SOV_item1)]
/ itemfontstyle = ("Arial", 2.00%, false, false, false, false, 5, 1)
/ itemspacing = 0.0%
/ showpagenumbers = false
/ showbackbutton = false
/ showquestionnumbers = false
/ responsefontstyle = ("Arial", 2.0%, false, false, false, false, 5, 1)
</surveypage>

<radiobuttons SOV_item1>
/ caption="<b>SOV item 1 </b>"
/ options=("<b>自分</b>:85<br><b>相手</b>:85", ":85<br>:76", ":85<br>:68", ":85<br>:59", ":85<br>:50", ":85<br>:41", ":85<br>:33", ":85<br>:24", ":85<br>:15")
/ optionvalues = ("1", "2", "3", "4","5", "6", "7", "8", "9")
/ required = true
/ orientation = horizontalequal
/ defaultResponse = 5
</radiobuttons>

<text myText1>
// items= ("You chose = <% radiobuttons.SOV_item1.selectedValue %>")
/ items = test_SOV_choice1
/ select = radiobuttons.SOV_item1.selectedValue
</text>

<trial showText1>
/stimulusFrames = [1=myText1]
///stimulusFrames = [1=SOV_explain; 2=myText1]
/timeout = 5000
</trial>

<block wrap_showText1>
/trials=[1=showText1]    
</block>

///

<item test_SOV_choice1>
/ 1="自分の取り分は85、相手の取り分は85 --> <% radiobuttons.SOV_item1.selectedValue %>"
/ 2="自分の取り分は85、相手の取り分は76 --> <% radiobuttons.SOV_item1.selectedValue %>"
/ 3="自分の取り分は85、相手の取り分は68 --> <% radiobuttons.SOV_item1.selectedValue %>"
/ 4="自分の取り分は85、相手の取り分は59 --> <% radiobuttons.SOV_item1.selectedValue %>"
/ 5="自分の取り分は85、相手の取り分は50 --> <% radiobuttons.SOV_item1.selectedValue %>"
/ 6="自分の取り分は85、相手の取り分は41 --> <% radiobuttons.SOV_item1.selectedValue %>"
/ 7="自分の取り分は85、相手の取り分は33 --> <% radiobuttons.SOV_item1.selectedValue %>"
/ 8="自分の取り分は85、相手の取り分は24 --> <% radiobuttons.SOV_item1.selectedValue %>"
/ 9="自分の取り分は85、相手の取り分は15 --> <% radiobuttons.SOV_item1.selectedValue %>"
</item>

///

No, it's not possible to display that information in real-time on the same page. You can only display it after the page has been submitted, on a different page.

Thanks, Dave!
On a related topic, is it possible to display a radiobuttons with /defaultResponse set to an arbitrary and fixed button (like, mouse clicks on radiobuttons are disabled and participants _cannot_ click on a different button?
I would like to use such a fixed radiobuttons to explain the meaning of a choice, before they get to actually make selection in subsequent trials.
Best,
EN

You can set to an arbitrary default response, but there is no way to prevent participants from changing it. Disabling clicksis not possible.

Thanks for confirming, Dave!
EN