[Loris-dev] Rules for textElement entries

Krisanne Litinas klitinas at umich.edu
Wed Jun 24 13:40:46 EDT 2015


Hi all,

I have a set of instruments + scoring and for the most part they look and
behave as desired.  Right now I am trying to implement constraints (rules)
on the various fields.

Most of the elements I'm using are of type = textElement.  Is there an easy
way that I can add a rule that the entry has to be one of a given list of
acceptable strings?  For instance, for a given entry have it only accept
values of 'yes' or 'no' and throw an error if the entered text is something
different (for specific logistical reasons here we need to use a text box
as opposed to a drop-down object).

Can anyone tell me if there is a straight-forward way of doing this -
perhaps somewhere in a .linst or .rules file?  I've also tried simply
changing the SQL field type to ENUM instead of VARCHAR but that seems to
just record the entry as NULL if the entry is outside of the acceptable set
of answers and does not give the type of visual feedback to the user that
would be optimal.

Thanks for any help,
-Krisanne
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.bic.mni.mcgill.ca/pipermail/loris-dev/attachments/20150624/f073d20e/attachment.html>


More information about the Loris-dev mailing list