react-toolbox/components/form
Nathan Marks f3d047e820 Remove jsx extension from component index files, replace with js 2015-11-22 17:49:46 -05:00
..
Form.jsx Rename lists subcomponents and little fixes 2015-11-22 22:28:24 +01:00
index.js Remove jsx extension from component index files, replace with js 2015-11-22 17:49:46 -05:00
readme.md Rename component doc to readme.md 2015-10-28 22:09:09 +07:00
style.scss Fix scss linter errors and bugfix in snackbar 2015-11-18 01:15:07 +01:00

readme.md

Form

var Form  = require('react-toolbox/components/form');
var fields : [
  {ref: "name", label: "Your Name", required: true, storage: true},
  {ref: "description", multiline: true, label: "Description", value: "Doer"},
  {ref: "birthdate", type: "date", label: "Birthdate"}
]

<Form attributes={fields} storage="my_toolbox_form" />

Properties

Name Type Default Description
attributes array Array of fields you want hold, fields can be instances of , , , or
className String Set the class-styles of the Component.
onChange Function Dispatch callback when values of the component changes.
onError Function Dispatch callback when a required field is null or has incorrect type.
onSubmit Function Dispatch callback when user clicks on submit
onValid Function Dispatch callback when all required fields are full-filled.
Storage String Sets a localStorage key for save all current field values.

Methods

getValue

Returns the value of the form.

form_instance.getValue();

setValue

Sets the value of the form component.

form_instance.setValue(newValue);