get-set-form-values
Simple object for getting and setting form values using javascript
Inspiration from this stackoverflow answer (for the setting part):
https://stackoverflow.com/a/35468919/464549
Install
npm install --save get-set-form-values
Or
<script src="dist/get-set-form-values.js"></script>
Usage
// Will only work in a browser var formValues = ; // Get a form elementvar mainForm = document; // Get the valuesvar values = formValues; // Set some valuesvar loadJsonValues = "radio": "d" "fulltext": "Area" "range": "9" "checkbox": "B" "input": "Text" "select": "saab" "mercedes" "select-single": "volvo";formValues;
Full example. See: index.html
Live example:
See: https://codepen.io/diversen/full/yoVQZq/
MIT © Dennis Iversen