Guide to: Using 'ss-required' Validation

What is 'ss-required' validation?

Unlike the "Required Validation" (validates='required') which verifies a contributor has submitted an answer using the Javascript on the page, Server Side Validation (validates='required ss-required') verifies that an answer has reached the server.  On a free text input, at least one non-whitespace character must be present. On a multiple choice or drop-down field, it enforces at least one item to be selected.

How do I use it?

Server side validation can be used on its own, or these validators can be using together by entering, "validates='required ss-required'" into your CML as an attribute of the element that you would like to require. This allows you to validate that an answer has been submitted on the page and an answer has been submitted to the server. In most cases, using "validates='required' " alone is sufficient, but using 'ss-required' adds an extra layer of security to ensure all contributors are answering the mandatory fields.

When should I avoid using 'ss-required' validation?

Because ss-required acts as a "universal validator" (it doesn't communicate with the CML on the page), it should only be used on "logic independent" questions, meaning questions that the contributor will definitely see and need answer for every unit. For questions that are "logic dependent" (questions that appear based on an answer to a previous question using an "only-if" statement), use validates='required' only.  Using ss-required on these questions will prevent contributors from submiting their work, even in instances where the questions are not displayed.

Was this article helpful?
0 out of 0 found this helpful

Have more questions? Submit a request
Powered by Zendesk