Guide to: CML Attributes

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


Every CML form element 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 form element. 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.


Every CML form element 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 form element 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.


Every CML form element 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. If no value is specified for a child element, the value of label will be reformatted and used instead - all letters will be lowercased and any special characters will become underscores (including spaces).


This will allow you to set a default response that will be selected or displayed (in the case of text input) on page-load. When specified on cml:select, it must be set to the label name of the option that will be selected by default. 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.


Every CML form element parent tag can have an instructions attribute. This will be displayed next to the generated form element 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.


Every CML form element 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.


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


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

Have more questions? Submit a request
Powered by Zendesk