-2

I need to build multiple business forms with basic validations.

Example field types:

  • required field
  • date (datepicker)
  • time (timepicker)
  • email
  • money
  • integer number (+ optional min/max value)
  • decimal number (specify precision)
  • phone number
  • social security number
  • zip code
  • credit card number
  • masked text (+ optional regex validation)
  • field with server side validation
  • etc.

Is there a lightweight library or framework that provides some or most of those field types out of the box as well as the ability to create custom fields with validations?

Z .
  • 12,657
  • 1
  • 31
  • 56
  • Not a framework, but have you ever used HTML's native [pattern matching](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input) on inputs? It has [>90% support](https://caniuse.com/#feat=input-pattern) in vendors. It allows for matching a regex client-side. Of course, as with any solution, server-side is necessary as well. – jhpratt Aug 22 '17 at 02:53

2 Answers2

1

You can these. I would think that a server-side validation is good too in addition to front-end validation

  1. Use HTML5 (frontend) native validation
  2. https://github.com/Zhouzi/GentleForm
  3. PHP some people have created their own class they shared Easiest Form validation library for PHP?
  4. JQuery validation https://jqueryvalidation.org/
mythoslife
  • 203
  • 1
  • 6
  • 20
0

I recommand you to use vuito, since it's template-based and isomorphic you can share your validations between front and back-end super easily. The package weight less than 1.3kB.

Mathix420
  • 872
  • 11
  • 21