# redux-form-validation-utils

> Validators for redux-form

Latest version **1.0.5** (published 2017-04-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install redux-form-validation-utils
pnpm add redux-form-validation-utils
yarn add redux-form-validation-utils
bun add redux-form-validation-utils
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2017-04-14 |
| First published | 2017-04-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Jaroslav Malek |
| Maintainers | malekjaroslav |

## Links

- npm: https://www.npmjs.com/package/redux-form-validation-utils
- Repository: https://github.com/malekjaroslav/redux-form-validation-utils
- Homepage: https://github.com/malekjaroslav/redux-form-validation-utils#readme
- Issues: https://github.com/malekjaroslav/redux-form-validation-utils/issues
- npm.io page: https://npm.io/package/redux-form-validation-utils

## Dependencies (2)

- [ramda](https://npm.io/package/ramda.md) ^0.23.0
- [babel-runtime](https://npm.io/package/babel-runtime.md) 6.x.x

## Recent versions

- 1.0.5 (latest) — 2017-04-14
- 1.0.4 — 2017-04-14
- 1.0.3 — 2017-04-14
- 1.0.2 — 2017-04-14
- 1.0.1 — 2017-04-14
- 1.0.0 — 2017-04-14

## README

# Creating Forms

To create form, use Redux-Form package http://redux-form.com/

## Form validation

### Short Form - Field validation
For short forms, which will not overflow user's viewport, we can use Field's `validate` prop along with `validateField` function and add an array of validator functions as an argument.

Example:
```
<Field
  name="username"
  validate={validateField([isRequired, isEmail])}
  label="Email"
  component={Input}
/>
```

### Long Form - Form validation
If the form is too long to fit into the user's viewport we will use `validateForm`.

In order to get global error message with number of errors and ability to do the "error hopping", we also need to add the `scrollToError` function on `onSubmitFail`.

```
reduxForm({
  form: 'components',
  validate: validateForm({
   email: [isEmail, isRequired],
   password: [isRequired],
  }),
  onSubmitFail: scrollToError
})
```

---
_Source: https://npm.io/package/redux-form-validation-utils · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
