Package Exports
- react-form-validation
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-form-validation) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
react-form-validation
Simple and powerful form validation library for React.
Getting Started
Install with NPM
npm install react-form-validationInstall with Bower
bower install react-form-validationInstall in web page
The project includes a browserified and minified version of the library that can be easily be
included into any web page. You may include the file /dist/react-form-validation.js on your
website.
<script src="/path/to/react-form-validation.js"></script>Basic usage
Create a form instance. This is the configuration for your form. You will have to pass this form as props to other components. You can save that object in the state of your component.
getInitialState: function() {
return {
form: new Instance({
fields: {
name: Rules.required()
}
})
};
}Use the Form, Input and Error Components inside your project.
<Form form={this.props.form} onSubmit={this.onSubmit}>
<Input name="name" type="text" form={this.props.form} />
<Error forName="name" form={this.props.form} />
</Form>