Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wellguimaraes/formalize
A form-2-object and object-2-form conversion library
https://github.com/wellguimaraes/formalize
Last synced: 12 days ago
JSON representation
A form-2-object and object-2-form conversion library
- Host: GitHub
- URL: https://github.com/wellguimaraes/formalize
- Owner: wellguimaraes
- License: mit
- Created: 2016-01-17T15:19:22.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-02-19T21:26:53.000Z (over 8 years ago)
- Last Synced: 2024-04-13T04:57:50.755Z (7 months ago)
- Language: JavaScript
- Size: 14.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Formalize.js
A form-to-object and object-to-form conversion library.#### Fill in a form with an object
```html
Dog
Cat
```
```js
// The object
var obj = {
customer: {
name: "John Doe",
pets: [
{name: "Rex", type: "cat"},
{name: "Fluffy", type: "dog"}
]
}
};// Fill it in
Formalize.objectToForm(obj, '#my-form');
```**Formalize** created two hidden fields (for the form missing fields):
```html
```
#### Get and object based on a form
```js
var obj = Formalize.formToObject('#my-form');
```