Removed noValidate and added formNoValidate to readme
This commit is contained in:
parent
261d605c19
commit
1fb4461121
15
README.md
15
README.md
|
|
@ -43,6 +43,7 @@ A form input builder and validator for React JS
|
|||
- [isPristine()](#ispristine)
|
||||
- [isFormDisabled()](#isformdisabled)
|
||||
- [validate](#validate)
|
||||
- [formNoValidate](#formnovalidate)
|
||||
- [Formsy.addValidationRule](#formsyaddvalidationrule)
|
||||
- [Validators](#validators)
|
||||
|
||||
|
|
@ -590,6 +591,20 @@ React.render(<Formy.Form disabled={true}/>);
|
|||
```
|
||||
You can create custom validation inside a form element. The validate method defined will be run when you set new values to the form element. It will also be run when the form validates itself. This is an alternative to passing in validation rules as props.
|
||||
|
||||
#### <a name="formnovalidate">formNoValidate</a>
|
||||
To avoid native validation behavior on inputs, use the React `formNoValidate` property.
|
||||
```javascript
|
||||
var MyInput = React.createClass({
|
||||
mixins: [Formsy.Mixin],
|
||||
render: function () {
|
||||
return (
|
||||
<div>
|
||||
<input formNoValidate type="number"/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
### <a name="formsyaddvalidationrule">Formsy.addValidationRule(name, ruleFunc)</a>
|
||||
An example:
|
||||
```javascript
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "formsy-react",
|
||||
"version": "0.12.0",
|
||||
"version": "0.12.1",
|
||||
"main": "src/main.js",
|
||||
"dependencies": {
|
||||
"react": "^0.13.1"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "formsy-react",
|
||||
"version": "0.12.0",
|
||||
"version": "0.12.1",
|
||||
"description": "A form input builder and validator for React JS",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
|
|
|||
|
|
@ -394,8 +394,7 @@ Formsy.Form = React.createClass({displayName: "Form",
|
|||
|
||||
return React.DOM.form({
|
||||
onSubmit: this.submit,
|
||||
className: this.props.className,
|
||||
novalidate: 'novalidate' in this.props ? this.props.novalidate : true
|
||||
className: this.props.className
|
||||
},
|
||||
this.traverseChildrenAndRegisterInputs(this.props.children)
|
||||
);
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -392,8 +392,7 @@ Formsy.Form = React.createClass({
|
|||
|
||||
return React.DOM.form({
|
||||
onSubmit: this.submit,
|
||||
className: this.props.className,
|
||||
novalidate: 'novalidate' in this.props ? this.props.novalidate : true
|
||||
className: this.props.className
|
||||
},
|
||||
this.traverseChildrenAndRegisterInputs(this.props.children)
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in New Issue