tomi77/backbone-forms-validators

View on GitHub
templates/minlength.pug

Summary

Maintainability
Test Coverage
extends ./base/layout

block title
  title Backbone-Forms minlength validator examples

block menu
  +menu('minlength')

block extraheaders
  script
    :coffee-script
      example = () ->
        @schema = () ->
          name:
            type: 'Text'
            title: 'Name'
            help: 'Enter text longer than 4 characters'
            validators: [
              type: 'minlength'
              minlength: 5
            ]
            editorAttrs:
              autocomplete: 'off'

      document.addEventListener "DOMContentLoaded", example, false
      window.addEventListener "load", example, false