A required parameter to pass the current context of the IReactComponent.
A optional parameter to set initial validator locale.
Event registered to notify the form submission in ReactFormInputValidation. After successfull validation it will emit the valid data.
Used to subscribe the event.
Name of the event.
Event listener for the corresponding event
A method to handle the onblur event for input in the form.
Handle onchange event for input fields.
A method to handle the react form submission.
Used to unsubscribe the event.
Name of the event to unsubscribe.
Exact event listener needs to be passed which is used to subscribe.
Set the validation rules for form fields. Find the available rules here.
The rules to validate.
Get the default language being used.
Get the raw object of messages for the given language.
The name of the rule.
Register Custom Validation Rules.
The name of the rule.
Returns a boolean to represent a successful or failed validation.
An optional string where you can specify a custom error message. :attribute inside errorMessage will be replaced with the attribute name.
Register an asynchronous rule which accepts a passes callback.
The data-async
custom attribute should be added in the html element.
The name of the rule.
You can supply global custom attribute names in your app with the attributes property.
A Callback function to configure the attribute name.
You can also add your own custom language by calling setMessages.
The name of the rule.
A error messages object.
Set the locale string for error messages.
Construct the React Form Input Validator instance.
import ReactFormInputValidation from "react-form-input-validation"; // Recommanded to do this in constructor or componentDidMount of the form component. this.form = new ReactFormInputValidation(this, { locale: 'en' });