Actions

QS

Em validation sq/nl: Difference between revisions

From LimeSurvey Manual

(Created page with "Nog een voorbeeld, je wilt alleen veelvouden van 3 toestaan, de vergelijking wordt dan:")
(Created page with "De gereserveerde variabele ''this'' wordt automatisch vervangen door een referentie naar het actieve invoerveld.")
Line 22: Line 22:
<syntaxhighlight lang="php" enclose="div">(this / 3) == floor(this/3)</syntaxhighlight>
<syntaxhighlight lang="php" enclose="div">(this / 3) == floor(this/3)</syntaxhighlight>


The reserved variable ''this'' is automatically replaced by a reference to the active text entry cell.
De gereserveerde variabele ''this'' wordt automatisch vervangen door een referentie naar het actieve invoerveld.


</onlyinclude>
</onlyinclude>


[[Category:Question Settings]][[Category:Advanced Question Settings]]
[[Category:Question Settings]][[Category:Advanced Question Settings]]

Revision as of 15:25, 26 August 2013


Subvraag validatie vergelijking (em_validation_sq)

 Tip: De functie is beschikbaar vanaf versie 1.92


Beschrijving

This is an equation that is used to validate each sub-question (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.

Geldige waarden

De vergelijking gebruikt de syntax die beschreven is in de Expressie Beheer, zonder de omringende accolades.

Voorbeelden

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, but that doesn't guarantee that the domain name exists. You could add a function to Expression Manager called validateEmail() which uses DNS lookup service to validate the existence of the domain.

Nog een voorbeeld, je wilt alleen veelvouden van 3 toestaan, de vergelijking wordt dan:

(this / 3) == floor(this/3)

De gereserveerde variabele this wordt automatisch vervangen door een referentie naar het actieve invoerveld.