React Form Package
Edit page
IntroductionInstallationFormSimple FormButtonFieldFieldWrapperRadioGroupSelectBasic UsagePropsForm ValidationStateonFocus onChange onBlurState ManipulationCustom Error MessagesFeedback on disabled ButtonStylingDynamic FieldsDynamic Fields 2Dynamic Fields 3Bind Input FieldsBind Input Fields 2Third Party ComponentsFile UploadWhy

Select

This component has to be a child within the <Form /> component. This component must have <option /> components with an value prop as children.

Basic Usage

import {
Form,
Select,
} from 'react-form-package';

Render a <Form /> with a <Select /> and a <Button /> component.

Select an option

Props

Property TypeRequiredDefaultDescription
id Stringtrue
typeStringtrueselect
requiredBoolfalsefalse
preOnChangeFunc false manipulate the state before its validated (see State Manipulation)
errorMessageStringfalsedefine your own custom error message for the input
onFocusFuncfalseget access to the state of the form when the user focus on the input
onChangeFuncfalseget access to the state of the form when the user changes the input
onBlurFuncfalseget access to the state of the form when the user blurs the input
bintToString, Arrayfalse  only needed for binding input fields. The id/ids of the input/inputs you want to manipulate
bintToAllwaysBoolfalse  only needed for binding input fields. Only needed if you want that the bindToCallback is triggered even the bound input field was already touched (blurred)
bindToCallbackFuncfalseonly needed for binding input fields. The callback to set the target's (bindTo) input value, which gets called onChange (return a single value or an array of values)