costicapuntaru / redux-form-validation Goto Github PK
View Code? Open in Web Editor NEWredux-form-validation
redux-form-validation
I'm getting an error when trying to use the dispatch function for email asyncValidation
Uncaught TypeError: dispatch is not a function
I've sent a PR with the fix
#8
I have the following JSON tree:
{
"name": "test",
"weekSchedule": {
"mon": "09:00",
"di": "09:00"
}
}
Now I would like to put a validator on the "mon" field in "weekSchedule".
i have tried "weekSchedule.mon" in the tree or same tree as the JSON.
But with neither the validator is working, how need this to be done?
Used Validator JSON file:
{
weekSchedule: {
mon: {
required: true,
pattern: /^([01]\d|2[0-3]):([0-5]\d)-([01]\d|2[0-3]):([0-5]\d)$/,
validateOnBlur: true
}
}
}
thanx for you help in advantage.
When specifying a minLength
rule of, say, n
, the validation error is displayed even when the length of the input is n
characters.
I'm guessing this is the offending line:
https://github.com/CosticaPuntaru/redux-form-validation/blob/master/src/basic-validations.js#L7
I'm setting a validation requirement that should be digits if there is any value but also optional.
My rules looks like:
{
myProp: {
required: false,
digits: true,
validateOnBlur: true
}
}
This validates correctly for digits, but if the textbox is empty, the digits validation is still triggered. Is this a bug?
Redux-Form v6 is out with some breaking changes to the Field
data structure.
http://redux-form.com/6.0.1/docs/api/Field.md/
http://redux-form.com/6.0.1/docs/MigrationGuide.md/
I believe some changes in redux-form-validation are required, specially regarding this new meta
object where the validation errors now reside.
Hello,
first I want to say thank you for this great tool,
I work on with the last version of React wich is decoupled from PropTypes, so I get this error:
_react.PropTypes is undefined
This project looks very appealing, but uses stage1 EcmaScript proposals (decorators, object spread). Those are subject to change (regardless of how likely it is), and using them for production goes against our company policy.
Is there any chance you can alter the syntax used in this module so that it relies only on the latest official EcmaScript standard (ES6)?
Running npm run lint
produces the following error:
/projects/redux-form-validation/src/basic-validations.js
1:2 error Parsing error: Illegal export declaration
/projects/redux-form-validation/src/form-messages/index.js
1:2 error Parsing error: Illegal import declaration
/projects/redux-form-validation/src/index.js
1:2 error Parsing error: Illegal import declaration
/projects/redux-form-validation/src/validation.js
1:2 error Parsing error: Illegal import declaration
โ 4 problems (4 errors, 0 warnings)
This also means that running npm run test
fails.
Once this is fixed, some unit tests can be written:
Hi.
I use ESlint. And ESlint displayed this error
error Unable to resolve path to module 'redux-form-validation' import/no-unresolved
I did import of redux-form-validation
import FormMessages, { generateValidation } from 'redux-form-validation';
For example
import { reduxForm } from 'redux-form';
works fine.
P.S. Validation works fine, but ESlint displayed that error.
How to resolve this issue?
I'm trying to create a form to either create or edit a user account. The form content and onSubmit functions all check on this.props.params.id
to see if it's an update or create. I also have an initialValues filed in the state i can check.
But for the password field, i'm having some issues. I would like to make it required on create, and not required on update.
@connect(({ forminitialstates }) => ({ initialValues: forminitialstates.adminUserEdit }))
@withStyles(BootstrapSass, s)
@reduxForm({
form: 'useraddedit',
fields: ['username', 'password', 'firstname', 'lastname', 'role'],
...generateValidation({
username: { validateOnBlur: true, required: true, email: true },
password: { validateOnBlur: true, required: true, minLength: 8 },
firstname: { validateOnBlur: true, required: true },
lastname: { validateOnBlur: true, required: true },
role: { validateOnBlur: true, required: true },
}),
}
)
class UserForm extends Component {
...
Is there any way i can get access to either the props or the state in the validation?
Currently there are no typings for this library.
I have [email protected]
installed, when I try to install the latest redux-form-validation
(v0.0.7), I am getting an unmet peer dependency.
I have tried this on npm 2.x and 3.x.
package:
{
"name": "temp",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"react": "^15.2.0",
"react-redux": "^4.4.5",
"redux": "^3.5.2",
"redux-form": "^5.3.1",
"redux-form-validation": "0.0.7"
}
}
error:
+-- UNMET PEER DEPENDENCY [email protected]
`-- [email protected]
`-- [email protected]
npm WARN [email protected] requires a peer of redux-form@^4.1.8 but none was installed.
npm WARN [email protected] No description
npm WARN [email protected] No repository field.
Is this an issue with this library? I have other libraries specifying a dependency and I have a higher version installed and it throws no error.
Is it possible to use redux-form-validation
with server-side validation? I mean the case, when server return some codes of errors, that correspond with the validation rules on client side, such as required
, minlength
, etc.
It could be useful to be able to store validation messages inside module.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.