You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
591 B

3 years ago
  1. import * as riot from 'riot'
  2. import FieldError from './components/field-error.riot'
  3. import FormValidator from './../../node_modules/@tentakelfabrik/tiny-validator/src/FormValidator'
  4. riot.register('field-error', FieldError)
  5. riot.mount('field-error')
  6. const formValidation = new FormValidator('form', {
  7. 'title': {
  8. 'presence': true,
  9. 'length': {
  10. 'maximum': 255
  11. }
  12. },
  13. 'description': {
  14. 'length': {
  15. 'maximum': 255
  16. }
  17. },
  18. 'type': {
  19. 'presence': true
  20. },
  21. 'visiblity': {
  22. 'presence': true
  23. }
  24. })