You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it be possible to programmatically define a default message for one of the built-in validators, such as required? That is, rather than defaulting to This field is required, can that string be set globally, perhaps at initiation, to something else? (I know that I can do this though data-attributes, but adding a data-attribute to every input becomes tedious pretty quickly, and I'm not seeing an alternative in the docs.)
If this is not already possible, perhaps the config object passed to new Pristine() could also take an object of messages, with keys there defining each of the built-in validators' default messages?
letdefaultConfig={classTo: 'form-group',errorClass: 'has-danger',successClass: 'has-success',errorTextParent: 'form-group',errorTextTag: 'div',errorTextClass: 'text-help',messages: {required: '🙅 This field is required!',email: 'Give us your email!',{...}}};
The text was updated successfully, but these errors were encountered:
@sha256 any update on this item? I see the feature/il8n branch is still open but it looks like this feature may have been merged in but I don't see it in the docs.
Is it be possible to programmatically define a default message for one of the built-in validators, such as
required
? That is, rather than defaulting toThis field is required
, can that string be set globally, perhaps at initiation, to something else? (I know that I can do this though data-attributes, but adding a data-attribute to every input becomes tedious pretty quickly, and I'm not seeing an alternative in the docs.)If this is not already possible, perhaps the config object passed to
new Pristine()
could also take an object ofmessages
, with keys there defining each of the built-in validators' default messages?The text was updated successfully, but these errors were encountered: