Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom message for empty textbox #7

Closed
cipriancx opened this issue Aug 22, 2018 · 3 comments
Closed

Custom message for empty textbox #7

cipriancx opened this issue Aug 22, 2018 · 3 comments

Comments

@cipriancx
Copy link

Hello,

For Textbox: it is possible to add a msgOnEmpty property to allow a custom message(when input is required and empty) instead of Msg.empty(nameText) ? or a way to override the Message object.

Thank you!

@edwardfxiao
Copy link
Owner

edwardfxiao commented Aug 23, 2018

hi, one way to do it is to provide msgOnError, but it does not specifically for error on empty only. Because it has so many types of error, the lib gets huge when trying to provide all kinds of the custom error message.

                validationOption={{
                  name: 'Name',
                  check: true, 
                  required: true, 
                  msgOnError: 'Custom message(for all error)'
                }}

The other way is that try to validate yourself. Check this out https://codesandbox.io/s/pjom8r78x7,
locate handleAccountChange and validate it manually.

@edwardfxiao
Copy link
Owner

maybe I could find a way to support this feature in next release. Please wait for v1.1.0

@edwardfxiao
Copy link
Owner

edwardfxiao commented Aug 28, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants