﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Millisecond Forums » Millisecond Forums » Inquisit 5  » When to use</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Sat, 04 Jul 2026 06:30:19 GMT</lastBuildDate><ttl>20</ttl><item><title>When to use</title><link>https://forums.millisecond.com/Topic20021.aspx</link><description>Hi,&lt;br/&gt;&lt;br/&gt;I understand that I need to use this syntax for combining text and properties / values and when defining the items attribute in a stimulis.&lt;br/&gt;&lt;br/&gt;But, Do I also need to use this syntax when inserting a value within a textbox (survey) element or with a boolean expression as seen in the following example?&amp;nbsp;&lt;br/&gt;&lt;br/&gt;&amp;lt;textbox Age&amp;gt;&lt;br/&gt; / Caption = “Age”&lt;br/&gt; / mask = integer&lt;br/&gt; / range (16,80)&lt;br/&gt; / value.ageans = &amp;lt;%textbox.Age.response%&amp;gt;&lt;br/&gt; &amp;lt;/textbox&amp;gt;&lt;br/&gt; &lt;br/&gt; &amp;lt;dropdown Gender&amp;gt;&lt;br/&gt; / caption = "Select Gender"&lt;br/&gt; / options = ("female", "male")&lt;br/&gt; If (&amp;lt;%dropdown.gender.caption&amp;gt;% == “female”)&lt;br/&gt; {value.genderans=0}&lt;br/&gt; Else&lt;br/&gt; {value.genderans=1}&lt;br/&gt; &amp;lt;/dropdown&amp;gt;&lt;br/&gt;&lt;br/&gt;Thanks!</description><pubDate>Wed, 02 Nov 2016 10:59:43 GMT</pubDate><dc:creator>JL</dc:creator></item><item><title>RE: When to use</title><link>https://forums.millisecond.com/Topic20034.aspx</link><description>Yes.</description><pubDate>Wed, 02 Nov 2016 10:59:43 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: When to use</title><link>https://forums.millisecond.com/Topic20033.aspx</link><description>Ok. Just to make sure: A value that I define can only be updated as part of an event attribute and never as a standalone command line like I wrote above?&lt;br/&gt;</description><pubDate>Wed, 02 Nov 2016 10:46:12 GMT</pubDate><dc:creator>JL</dc:creator></item><item><title>RE: When to use</title><link>https://forums.millisecond.com/Topic20030.aspx</link><description>&amp;gt; / value.ageans = textbox.Age.response&lt;br/&gt;&lt;br/&gt;This line is not valid syntax. If you "insert this line of code into a &amp;lt;surveypage&amp;gt;", it will not do anything. Just like with the dropdown, what you want is &lt;br/&gt;&lt;br/&gt;&amp;lt;surveypage mypage&amp;gt;&lt;br/&gt;/ ontrialend = [if (dropdown.gender.response == "female") values.genderans = 0 else values.genderans = 1; ]&lt;br/&gt;&lt;strong&gt;/ ontrialend = [values.ageans =  textbox.Age.response]&lt;/strong&gt;&lt;br/&gt;/ questions = [1=gender; 2=age]&lt;br/&gt;...&lt;br/&gt;&amp;lt;/surveypage&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;</description><pubDate>Wed, 02 Nov 2016 10:30:19 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: When to use</title><link>https://forums.millisecond.com/Topic20028.aspx</link><description>Thanks!&lt;br/&gt;&lt;br/&gt;One more question regarding the above example:&lt;br/&gt;&lt;br/&gt;/ value.ageans = textbox.Age.response&lt;br/&gt;&lt;br/&gt;If i insert this line of code into a &amp;lt;surveypage&amp;gt; could I use the the value extracted from the textbox.age.response as an integer? If not, how is it possible to get the age as an integer so it can be used for mathematical expressions later on?&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;</description><pubDate>Wed, 02 Nov 2016 10:17:25 GMT</pubDate><dc:creator>JL</dc:creator></item><item><title>RE: When to use</title><link>https://forums.millisecond.com/Topic20025.aspx</link><description>I'm sorry, but this code does not make sense:&lt;br/&gt;&lt;br/&gt;&amp;lt;dropdown Gender&amp;gt;&lt;br/&gt; / caption = "Select Gender"&lt;br/&gt; / options = ("female", "male")&lt;br/&gt; If (&amp;lt;%dropdown.gender.caption&amp;gt;% == “female”)&lt;br/&gt; {value.genderans=0}&lt;br/&gt; Else&lt;br/&gt; {value.genderans=1}&lt;br/&gt; &amp;lt;/dropdown&amp;gt;&lt;br/&gt;&lt;br/&gt;#1: You don't want to access the dropdown's caption. You want to query its response.&lt;br/&gt;#2: You cannot just put conditional logic in an element and expect it to work. Conditional logic needs to reside in event attributes (/ontrialbegin, ontrialend, etc.). A &amp;lt;dropdown&amp;gt; has no event attributes -- the &amp;lt;surveypage&amp;gt; the dropdown resides on has.&lt;br/&gt;&lt;br/&gt;&amp;lt;surveypage mypage&amp;gt;&lt;br/&gt;/ ontrialend = [if (dropdown.gender.response == "female") values.genderans = 0 else values.genderans = 1; ]&lt;br/&gt;/ questions = [1=gender; ...]&lt;br/&gt;...&lt;br/&gt;&amp;lt;/surveypage&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;dropdown Gender&amp;gt;&lt;br/&gt; / caption = "Select Gender"&lt;br/&gt; / options = ("female", "male")&lt;br/&gt;&amp;lt;/dropdown&amp;gt;</description><pubDate>Wed, 02 Nov 2016 08:47:50 GMT</pubDate><dc:creator>Dave</dc:creator></item></channel></rss>