<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.limesurvey.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=IngeborgNor</id>
	<title>LimeSurvey Manual - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.limesurvey.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=IngeborgNor"/>
	<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/Special:Contributions/IngeborgNor"/>
	<updated>2026-08-10T18:09:42Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.9</generator>
	<entry>
		<id>https://www.limesurvey.org/manual/index.php?title=QS:Em_validation_q&amp;diff=73803</id>
		<title>QS:Em validation q</title>
		<link rel="alternate" type="text/html" href="https://www.limesurvey.org/manual/index.php?title=QS:Em_validation_q&amp;diff=73803"/>
		<updated>2017-06-22T11:39:14Z</updated>

		<summary type="html">&lt;p&gt;IngeborgNor: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;onlyinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Whole question validation equation (em_validation_q) === &amp;lt;!--T:191--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:192--&amp;gt;&lt;br /&gt;
{{FeatureStarting|v=1.92}} &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:193--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:194--&amp;gt;&lt;br /&gt;
This is an equation that is used to validate the entire question (e.g all of its parts collectively for a multi-answer question).  If the question fails the validation criteria, then then em_validation_q_tip message has the CSS style .error set to it.  This tip uses the .em_q_fn_validation CSS style, which is hidden by default within template.css.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:195--&amp;gt;&lt;br /&gt;
The main difference between this feature and the Sub-question validation equations (em_validation_sq option) is that for this feature, if the question (or question parts) fail validation, then an error message could be shown.  For the sub-question validation, each text entry cell (e.g. in array, but also applies to single entry question types) will be styled so that the background color is pink.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:196--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Valid values&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:212--&amp;gt;&lt;br /&gt;
*Any equation, using [[Expression Manager|Expression Manager]] syntax, without surrounding curly braces.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:197--&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:211--&amp;gt;&lt;br /&gt;
**You want to collect demographic information from users via a multiple short text question, and you want to validate that the user has entered a reasonable email and phone number.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:198--&amp;gt;&lt;br /&gt;
This example shows how the question looks with invalid answers:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:199--&amp;gt;&lt;br /&gt;
[[File:validation-invalid-both.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:200--&amp;gt;&lt;br /&gt;
And here is what it looks like with one invalid answer:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:201--&amp;gt;&lt;br /&gt;
[[File:validation-invalid-phone.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:202--&amp;gt;&lt;br /&gt;
Here is how you edit a question to enter that information:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:203--&amp;gt;&lt;br /&gt;
[[File:validation-gui.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:204--&amp;gt;&lt;br /&gt;
And here is part of the Show Logic File output that lets you validate the accuracy of your expression and ensure there are no syntax errors:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:205--&amp;gt;&lt;br /&gt;
[[File:validation-logic.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:206--&amp;gt;&lt;br /&gt;
As you can see, the validation equation tests that both the email and phone are either empty or match a regular expression filter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:207--&amp;gt;&lt;br /&gt;
The validation tip only shows the warning message if the phone or email appears invalid.&lt;br /&gt;
&lt;br /&gt;
Please see the forum for examples: https://www.limesurvey.org/forum/can-i-do-this-with-limesurvey/111858-validate-phone-and-email-in-multiple-short-text&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:208--&amp;gt;&lt;br /&gt;
{{Hint|Text=Remember, LimeSuvey uses the Perl syntax for regular expressions, so they should start and end with / (slash character)!}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:209--&amp;gt;&lt;br /&gt;
&amp;lt;/onlyinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:210--&amp;gt;&lt;br /&gt;
[[Category:Question Settings]][[Category:Advanced Question Settings]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>IngeborgNor</name></author>
	</entry>
</feed>