Em validation sq: Difference between revisions
From LimeSurvey Manual
DenisChenu (talk | contribs) (Remove the "validateEmail" function creation (must be in Devlopper manula)) |
mNo edit summary |
||
Line 5: | Line 5: | ||
===Sub-question validation equation (em_validation_sq)=== <!--T:219--> | ===Sub-question validation equation (em_validation_sq)=== <!--T:219--> | ||
<!--T:221--> | <!--T:221--> | ||
Line 13: | Line 10: | ||
<!--T:222--> | <!--T:222--> | ||
This is an equation that is used to validate each | This is an equation that is used to validate each subquestion (text field) individually. Any text field that does not pass these validation conditions will have its background color turned pink (using the .em_sq_fn_validation CSS style) to highlight the error. Note that this is available in addition to the regular expression-based validation option. | ||
<!--T:223--> | <!--T:223--> | ||
Line 40: | Line 37: | ||
<!--T:231--> | <!--T:231--> | ||
[[Category:Question Settings]][[Category: | [[Category:Question Settings]][[Category:Question Logic Settings]] | ||
</translate> | </translate> |
Revision as of 14:55, 21 February 2018
Sub-question validation equation (em_validation_sq)
Description
This is an equation that is used to validate each subquestion (text field) individually. Any text field that does not pass these validation conditions will have its background color turned pink (using the .em_sq_fn_validation CSS style) to highlight the error. Note that this is available in addition to the regular expression-based validation option.
Valid values
Any equation, using Expression Manager syntax, without surrounding curly braces.
Examples
Say you have a multiple short text question and you want to collect email addresses. You could use the regular expression validator to make sure the email address has proper syntax.
As another example, say you only want to allow numbers that are a multiple of 3, the equation would be:
(this / 3) == floor(this/3)
The reserved variable this is automatically replaced by a reference to the active text entry cell.