﻿<?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 6  » Error message for textboxes</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Tue, 05 May 2026 17:07:46 GMT</lastBuildDate><ttl>20</ttl><item><title>Error message for textboxes</title><link>https://forums.millisecond.com/Topic31556.aspx</link><description>Hi all! When I present a surveypage containing 2 textboxes I need participants to be only allowed to introduce values that sum 5 in total (not higher nor lower, e.g. 2 and 3), if they introduce values different than 5 I would like them to see a text indicating the error so they can correct it. I have tried as follows:&lt;br/&gt;&lt;br/&gt;&amp;lt;surveypage CoalitionOffer&amp;gt;&lt;br/&gt;/ questions = [1=OfferBox1, OfferBox2]&lt;br/&gt;/ stimulusframes = [1 = OfferPic, CoalitionOfferText, OfferBoxYou, OfferBoxPartner]&lt;br/&gt;/ showbackbutton = false&lt;br/&gt;/ showquestionnumbers = false&lt;br/&gt;/ showpagenumbers = false&lt;br/&gt;/ showmousecursor = true&lt;br/&gt;/ finishlabel = "Click here to continue"&lt;br/&gt;/ branch = [if (textbox.OfferBox1.response + textbox.OfferBox2.response != 5) text.erroroffer]&lt;br/&gt;/ branch = [if (textbox.OfferBox1.response + textbox.OfferBox2.response == 5) likert.Liking1]&lt;br/&gt;&amp;lt;/surveypage&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text erroroffer&amp;gt;&lt;br/&gt;/ items = ("please introduce the correct values")&lt;br/&gt;/ color = (0, 255, 0)&lt;br/&gt;/ fontstyle = ("Arial", 3%, true)&lt;br/&gt;/ position = (50%,50%)&lt;br/&gt;/ vjustify = center&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;In this case, If they introduce “5 and 6” they are not allowed to continue but the error message is not displayed. And f they type “5 and 4” they move to the next page "likert.liking1".&lt;br/&gt;&lt;br/&gt;Thank you in advance for your help!!&lt;br/&gt;Anabela&lt;br/&gt;</description><pubDate>Wed, 19 May 2021 11:48:37 GMT</pubDate><dc:creator>anabela_c</dc:creator></item><item><title>RE: Error message for textboxes</title><link>https://forums.millisecond.com/Topic31563.aspx</link><description>&lt;blockquote data-id="31556" class="if-quote-wrapper" unselectable="on" data-guid="1621424877820" id="if_insertedNode_1621424877150" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="31556" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="31556" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="31556" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;anabela_c - 5/19/2021&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-31556"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;Hi all! When I present a surveypage containing 2 textboxes I need participants to be only allowed to introduce values that sum 5 in total (not higher nor lower, e.g. 2 and 3), if they introduce values different than 5 I would like them to see a text indicating the error so they can correct it. I have tried as follows:&lt;br/&gt;&lt;br/&gt;&amp;lt;surveypage CoalitionOffer&amp;gt;&lt;br/&gt;/ questions = [1=OfferBox1, OfferBox2]&lt;br/&gt;/ stimulusframes = [1 = OfferPic, CoalitionOfferText, OfferBoxYou, OfferBoxPartner]&lt;br/&gt;/ showbackbutton = false&lt;br/&gt;/ showquestionnumbers = false&lt;br/&gt;/ showpagenumbers = false&lt;br/&gt;/ showmousecursor = true&lt;br/&gt;/ finishlabel = "Click here to continue"&lt;br/&gt;/ branch = [if (textbox.OfferBox1.response + textbox.OfferBox2.response != 5) text.erroroffer]&lt;br/&gt;/ branch = [if (textbox.OfferBox1.response + textbox.OfferBox2.response == 5) likert.Liking1]&lt;br/&gt;&amp;lt;/surveypage&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;text erroroffer&amp;gt;&lt;br/&gt;/ items = ("please introduce the correct values")&lt;br/&gt;/ color = (0, 255, 0)&lt;br/&gt;/ fontstyle = ("Arial", 3%, true)&lt;br/&gt;/ position = (50%,50%)&lt;br/&gt;/ vjustify = center&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;In this case, If they introduce “5 and 6” they are not allowed to continue but the error message is not displayed. And f they type “5 and 4” they move to the next page "likert.liking1".&lt;br/&gt;&lt;br/&gt;Thank you in advance for your help!!&lt;br/&gt;Anabela&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="31556"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;A &amp;lt;text&amp;gt; element is not something you can /branch to. You may&amp;nbsp; /branch to a &amp;lt;trial&amp;gt; displaying that &amp;lt;text&amp;gt;.</description><pubDate>Wed, 19 May 2021 11:48:37 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: Error message for textboxes</title><link>https://forums.millisecond.com/Topic31559.aspx</link><description>&lt;blockquote data-id="31556" class="if-quote-wrapper" unselectable="on" data-guid="1621424016268" id="if_insertedNode_1621424014927" contenteditable="false"&gt;&lt;a class="quote-para" unselectable="on" style="display: none;" href="#" data-id="31556" title="Move Cursor Below" contenteditable="false"&gt;&lt;span unselectable="on"&gt;+&lt;/span&gt;&lt;/a&gt;&lt;a class="quote-delete" unselectable="on" style="display: none;" href="#" data-id="31556" title="Delete Quote" contenteditable="false"&gt;&lt;span unselectable="on"&gt;x&lt;/span&gt;&lt;/a&gt;&lt;span unselectable="on" class="quote-markup"&gt;[quote]&lt;/span&gt;&lt;div unselectable="on" class="if-quote-header" contenteditable="false"&gt;&lt;div unselectable="on" class="if-quote-toggle-wrapper"&gt;&lt;a class="if-quote-toggle quote-link" href="#" data-id="31556" title=" "&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[b]&lt;/span&gt;anabela_c - 5/19/2021&lt;span unselectable="on" class="quote-markup"&gt;[/b]&lt;/span&gt;&lt;/div&gt;&lt;div class="if-quote-message if-quote-message-31556"&gt;&lt;div class="if-quote-message-margin" contenteditable="true"&gt;Hi all! When I present a surveypage containing 2 textboxes I need participants to be only allowed to introduce values that sum 5 in total (not higher nor lower, e.g. 2 and 3), if they introduce values different than 5 I would like them to see a text indicating the error so they can correct it. I have tried as follows:&lt;br/&gt;&lt;br/&gt;&amp;lt;surveypage CoalitionOffer&amp;gt;&lt;br/&gt;/ questions = [1=OfferBox1, OfferBox2]&lt;br/&gt;/ stimulusframes = [1 = OfferPic, CoalitionOfferText, OfferBoxYou, OfferBoxPartner]&lt;br/&gt;/ showbackbutton = false&lt;br/&gt;/ showquestionnumbers = false&lt;br/&gt;/ showpagenumbers = false&lt;br/&gt;/ showmousecursor = true&lt;br/&gt;/ finishlabel = "Click here to continue"&lt;br/&gt;/ branch = [if (textbox.OfferBox1.response + textbox.OfferBox2.response != 5) text.erroroffer]&lt;br/&gt;/ branch = [if (textbox.OfferBox1.response + textbox.OfferBox2.response == 5) likert.Liking1]&lt;br/&gt;&amp;lt;/surveypage&amp;gt;&lt;br/&gt;[code]&lt;br/&gt;&amp;lt;text erroroffer&amp;gt;&lt;br/&gt;/ items = ("please introduce the correct values")&lt;br/&gt;/ color = (0, 255, 0)&lt;br/&gt;/ fontstyle = ("Arial", 3%, true)&lt;br/&gt;/ position = (50%,50%)&lt;br/&gt;/ vjustify = center&lt;br/&gt;&amp;lt;/text&amp;gt;[/code]&lt;br/&gt;&lt;br/&gt;In this case, If they introduce “5 and 6” they are not allowed to continue but the error message is not displayed. And f they type “5 and 4” they move to the next page "likert.liking1".&lt;br/&gt;&lt;br/&gt;Thank you in advance for your help!!&lt;br/&gt;Anabela&lt;br/&gt;&lt;a class="if-quote-goto quote-link" href="#" data-id="31556"&gt;&lt;span class="goto"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;span unselectable="on" class="quote-markup"&gt;[/quote]&lt;/span&gt;&lt;/blockquote&gt;&lt;br/&gt;Hi, &lt;br/&gt;&lt;br/&gt;I'm not an Inquisit professional, but I've had the same problem in the past. Inquisit can't parse a stimulus element (like "text.erroroffer") as a consequence of a branch. One way of solving this is to have the branch point to the same trial (i.e. restart the trial) and make the message visible at the same time, like this for example:&lt;br/&gt;&lt;br/&gt;[code]&lt;br/&gt;&amp;lt;text erroroffer&amp;gt;&lt;br/&gt;/ items = ("please introduce the correct values")&lt;br/&gt;/ color = (0, 255, 0)&lt;br/&gt;/ fontstyle = ("Arial", 3%, true)&lt;br/&gt;/ position = (50%,50%)&lt;br/&gt;/ vjustify = center&lt;br/&gt;&lt;br/&gt;/txcolor = transparent&lt;br/&gt;&lt;br/&gt;&amp;lt;/text&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;surveypage CoalitionOffer&amp;gt;&lt;br/&gt;/ questions = [1=OfferBox1, OfferBox2]&lt;br/&gt;/ stimulusframes = [1 = OfferPic, CoalitionOfferText, OfferBoxYou, OfferBoxPartner]&lt;br/&gt;/ showbackbutton = false&lt;br/&gt;/ showquestionnumbers = false&lt;br/&gt;/ showpagenumbers = false&lt;br/&gt;/ showmousecursor = true&lt;br/&gt;/ finishlabel = "Click here to continue"&lt;br/&gt;/ branch = [if (textbox.OfferBox1.response + textbox.OfferBox2.response != 5) {text.erroroffer.txcolor = red;&amp;nbsp;textbox.OfferBox1.defaultresponse =&amp;nbsp;textbox.OfferBox1.response;&amp;nbsp;textbox.OfferBox2.defaultresponse = textbox.OfferBox2.response;  surveypage.CoalitionOffer}]&lt;br/&gt;/ branch = [if (textbox.OfferBox1.response + textbox.OfferBox2.response == 5) {text.erroroffer.txcolor = transparent; textbox.OfferBox1.defaultresponse = values.YourOriginalDefault1; textbox.OfferBox2.defaultresponse = values.YourOriginalDefault2; likert.Liking1}]&lt;br/&gt;&amp;lt;/surveypage&amp;gt;&lt;br/&gt;&lt;br/&gt;[/code]&lt;br/&gt;&lt;br/&gt;I haven't tested this, but the code should return a participant to the same surveypage if they make an invalid entry, display your warning in red and retain the responses they just entered. Hope this helps!&lt;br/&gt;</description><pubDate>Wed, 19 May 2021 11:41:13 GMT</pubDate><dc:creator>AKrishna</dc:creator></item></channel></rss>