Databridge is a serialization jQuery plugin to read data from forms, and to set data to forms. Supports nested objects, boolean and array checkboxes, on fly data formatting and conversion. Works with any elements with attributes name or data-name, not only inputs.
Include script into you page:
<script src="path/to/plugin/mk-databridge.min.js" type="text/javascript"></script>
To set data call databridge with data object
$('.form-container').databridge(dataObject);
To get data call databridge with no arguments
var dataObject = $('.form-container').databridge();
If you need to convert your data for view, for example, to show timestamp as date string. You can point to mapper function in html attribute data-map="my.mapper.fuction". Mapper function has to return converted value. It takes two arguments: original value and mode (it can be 'set' or 'get'), 'this' variable is set to input element.
Mapper function gets this variable set to input element, so you can control it from mapper for additional effects.
You can create special views this way.
You can use nested objects with either 'dot'-notation or 'square-brackets'-notation.