Simple demo how to use ConfiForms Field Definition Rule to limit a number of characters a field can accept

 

The view in the editor

And this is how the rule is defined

 

 

The storage format for the solution / concept

 

<ac:structured-macro ac:macro-id="931f9659-f866-4c7b-b0e7-1ff74f78a5e8" ac:name="confiform" ac:schema-version="1">
  <ac:parameter ac:name="formName">form1</ac:parameter>
  <ac:rich-text-body>
    <ac:structured-macro ac:macro-id="9edebdcd-7d37-4608-a8d9-f55bf8ca0551" ac:name="confiform-entry-register" ac:schema-version="1">
      <ac:parameter ac:name="embedded">true</ac:parameter>
      <ac:rich-text-body>
        <p> </p>
      </ac:rich-text-body>
    </ac:structured-macro>
    <p>
      <ac:structured-macro ac:macro-id="f22bb357-6bdf-4af8-a5a3-5db4a30c49f5" ac:name="confiform-field-definition" ac:schema-version="1">
        <ac:parameter ac:name="fieldName">myfield</ac:parameter>
        <ac:parameter ac:name="fieldLabel">My field</ac:parameter>
        <ac:parameter ac:name="fieldDescription">Max 10 characters</ac:parameter>
        <ac:parameter ac:name="type">text</ac:parameter>
      </ac:structured-macro>
    </p>
    <p>
      <ac:structured-macro ac:macro-id="cb25b449-6890-4239-82de-c9245e8af60e" ac:name="confiform-field-definition-rules" ac:schema-version="1">
        <ac:parameter ac:name="condition">myfield.asLength:&gt;10</ac:parameter>
        <ac:parameter ac:name="fieldName">Sorry, only 10 (or less) characters allowed</ac:parameter>
        <ac:parameter ac:name="action">Validation rule</ac:parameter>
        <ac:parameter ac:name="actionFieldName">myfield</ac:parameter>
      </ac:structured-macro>
    </p>
  </ac:rich-text-body>
</ac:structured-macro>