Dynamic form validation only with HTML https://sinaru.github.io/dynamo-forms/
Find a file
2020-03-21 19:36:18 +00:00
.github Node.js CI 2020-03-21 19:16:57 +00:00
dist Update dist 2019-09-09 22:55:21 +01:00
docs Update guide 2019-09-09 23:41:09 +01:00
examples/validators Fix example 2019-07-11 01:00:36 +01:00
src Add email validation for type validator 2019-09-09 22:55:03 +01:00
test Add email validation for type validator 2019-09-09 22:55:03 +01:00
.babelrc refactor 2019-07-11 00:31:19 +01:00
.editorconfig Introduce FunctionValidator 2019-07-10 22:38:22 +01:00
.eslintrc add tools and update configuration 2019-07-05 20:49:01 +01:00
.gitignore add .gitignore file 2019-05-26 11:41:34 +01:00
.travis.yml update travis config 2019-07-05 21:57:49 +01:00
CODE_OF_CONDUCT.md Add CODE_OF_CONDUCT.md 2019-07-29 23:06:30 +01:00
CONTRIBUTING.md Add CONTRIBUTING.md 2019-07-29 22:54:58 +01:00
jest.config.js migrate mocha tests to Jest 2019-07-06 12:07:59 +01:00
LICENSE Add LICENSE 2019-07-29 22:40:54 +01:00
package-lock.json Bump acorn from 5.7.3 to 5.7.4 2020-03-21 19:27:53 +00:00
package.json Build for production and development in same command 2019-07-11 23:10:42 +01:00
README.md Fix readme 2019-09-11 19:21:32 +01:00
webpack.config.js Add source map only for development 2019-07-11 23:10:05 +01:00

DynamoForms

Build Status Contributor Covenant

Make your HTML forms super smart only with HTML.

DynamoForms is a JavaScript library that uses HTML syntax to provide dynamic and advance form validation for your web pages.

User Guide: https://sinaru.github.io/DynamoForms/

Installation

You can either use dynamo-forms.js or dynamo-forms.min.js found in dist folder. Then add .dynamo-forms css class to each
<form> you want to validate.

In the form you should have an HTML element with .dynamo-errors. This is used as the parent element to render the form errors.

You should add data-dyn-field attribute to any input that should be validated. Then you can add the data-dyn-... attributes to use the validators and build your form validations.

That's the power of DynamoForms. All the form validation behavior is defined by using data-dyn-... data attributes.

When you submit the form, if there are any validation errors, they will be displayed otherwise the form will get submit.

Here is an example that uses Type validator for an input.

<form class="dynamo-forms">
   <div class="dynamo-errors"></div>
   <div>
       <label>Amount</label>
       <input 
         name="number" type="text"
         data-dyn-field
         data-dyn-name="Amount"
         data-dyn-type
         data-dyn-type-type="number"
       >
   </div>

   <button type="submit">Submit</button>
</form>

Development

You should have at least Node.js 10. See installation guide on how to install Node.js.

Simply run npm install to install the packages.