Fixed bug with internal ajax

This commit is contained in:
christianalfoni 2015-04-01 13:45:51 +02:00
parent eb3eaa6544
commit ebd17fde62
3 changed files with 58 additions and 14 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -232,14 +232,15 @@ Formsy.Form = React.createClass({
this.props.onChange(this.getCurrentValues());
}
if (!component.props.required && !component._validations && !component.checkValidity) {
return;
var isValid = true;
if (component.validate) {
isValid = component.validate();
} else if (component.props.required || component._validations) {
isValid = this.runValidation(component);
}
// Run through the validations, split them up and call
// the validator IF there is a value or it is required
var isValid = this.runValidation(component);
component.setState({
_isValid: isValid,
_serverError: null