Follow

cml:text - Single Line Text Input

cml:text

Renders a single line text field. Accepts all common attributes.

<cml:text label="Sample text field:" />

 

Additional attributes

default

If supplied, the value of this attribute will be pre-filled in the text box when the page is loaded. It will not be submitted and will fail the required validator until the contributor enters text into it.

<cml:text label="Sample text field:" default="Enter text here" />

Note: You can allow contributors to submit more than one answer by using the attribute multiple="true". 


 

Validators

We recommend using some of the following validators to clean contributor inputs so that the inputs are uniform and will aggregate more easily:

  • clean:['trim'] - Removes leading and trailing whitespace.
  • clean:['titlecase'] - Capitalizes all words that are not all uppercase nor most conjunctions.
  • clean:['uppercase'] - Replaces all lowercase letters with uppercase letters.
  • clean:['lowercase'] - Replaces all uppercase letters with lowercase letters.

To use multiple validators, add a comma after each clean validator like so: clean:['trim','titlecase']"

 

For a list of more input cleaning validators, please visit this article.

 


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


Have more questions? Submit a request
Powered by Zendesk