IntroductionInstallationFormSimple FormButtonBasic UsageUsage with actual valuesPropsFieldFieldWrapperRadioGroupSelectForm ValidationStateonFocus onChange onBlurState ManipulationCustom Error MessagesFeedback on disabled ButtonStylingDynamic FieldsDynamic Fields 2Dynamic Fields 3Bind Input FieldsBind Input Fields 2Third Party ComponentsFile UploadWhy
Button
This component has to be a child within the <Form />
component. This component gets the state from the <Form />
component and returns it on its onClick prop. If the <Form />
component has the validate prop set, the button will be disabled as long as the form is valid.
Basic Usage
import {Form,Button,} from 'react-form-package';
Render a <Form />
with a <Button />
component.
Usage with actual values
import {Form,Button,Field,} from 'react-form-package';
Render a <Form />
with a <Button />
and a <Field />
component.
Props
Property | Type | Required | Default | Description |
---|---|---|---|---|
id | String | true | ||
type | String | true | submit | |
onClick | Func | false | returns the state of the form | |
onMouseEnter | Func | false | returns the event and the state of the form | |
onMouseLeave | Func | false | returns the event and the state of the form (does not work on disabled buttons) | |
rfpRole | String | false | only needed for dynamically added fields, either addField or removeField | |
fieldId | String | false | only needed for dynamically added fields on a button with rfpRole removeField (the id of the field to remove) | |
field | Object | false | only needed for dynamically added fields on a button with rfpRole addField . This object holds at least id , type , and may hold min , max , required , match , sameAs |