Follow

Guide to: CML Attributes

These attributes can be used within the opening tag for a CML question:

 

label
Every CML question parent tag (along with the cml:checkbox, cml:radio, and cml:option children tags) can have a label attribute. This will be displayed next to the generated question. If no name attribute is specified on a parent tag, the label will be converted into a name by removing non-alpha-numeric characters and replacing spaces with an underscore.

 

name
Every CML question parent tag (except cml:group) along with the cml:checkbox and cml:radio child tags can have a name attribute. This must be unique across all other question tags in the job. The name should not contain capital letters, spaces, or non-alpha-numeric characters. This will become the header of a column in your generated CSV containing the responses for this particular element.

 

value
Every CML questions child tag (cml:checkbox, cml:radio, and cml:option) can be set with a value. The value of value will determine the output of that particular response in your generated CSV. Please note that any spaces in value attributes will not be accepted, as they will break any test questions created. Instead, please use underscores as spaces within value attributes (ex:"type_of_sentiment"). If no value is specified for a child element, the value of label will be reformatted and used instead.

Note: While the value attribute is not required, it is highly recommended to include in CML questions child tags of cml:select (cml:option) if Google translate is not disabled for the job. If a contributor translates the page while submitting a cml:option without a hardcoded value attribute, the results will return the answer in the translated language.

 

default
This will allow you to set a default response that will be selected or displayed (in the case of text input) on page-load. This can be used incml:textarea,cml:text, andcml:checkboxes. When used on cml:textarea or cml:text, this provides an example input for the user and disappears once the user click into the text box. If not present, default="false".

 

instructions
Every CML questions parent tag can have an instructions attribute. This will be displayed next to the generated questions to help clarify the desired input. If both an instructions attribute and a cml:instructions tag is specified, only the value of the attribute will be used.

 

only-if
Every CML questions parent tag can have an only-if attribute. The value of this attribute should be the name of the field a user must complete before this field or group of fields will be displayed. To designate logic based on specific responses in a question, take a look at this article on CML Logic.

 

validates
Every CML questions parent tag can have a validates attribute. This attribute enforces the specified validations to occur on this questions. Take a look at this article on validations for more details.

  


Was this article helpful?
6 out of 11 found this helpful


Have more questions? Submit a request
Powered by Zendesk