react-toolbox/components/form
Javi Velasco 0cb8d8bdb2 Get rid of jsx extensions 🔮 2016-04-10 21:23:04 +02:00
..
Form.js Get rid of jsx extensions 🔮 2016-04-10 21:23:04 +02:00
index.js Remove jsx extension from imports in components 2015-11-28 20:24:46 +01: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);