-
-
Notifications
You must be signed in to change notification settings - Fork 115
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
Customize validation message example + documentation issues #73
Comments
Then add a
|
@Szayet Thank you soooooo much for the help and reply!! According to your instruction, I can call the custom validation method and get return value as I expected, however, the validation error message is not passed to client side to display. Here is my code in imports/Users.js:
the meteor mtd 'accountsIsEmailAvailable ' is using Accounts.findUserByEmail(email) in Accounts package and returns the user obj if it finds the email already existing in db. And here is my console log and message print I can see that the custom function is called async at end of my redux dispatch error messages. But I would like to add this email error to the client side for displaying, do you have any suggestion on that? Yes, I fully understand that the package is still newish and it is difficult to manage so many useful & popular packages at the same time! Really appreciate all your hard work and the convenience that @aldeed 's packages offer. |
@ZhuQinglei No problem, I'm glad it helped. 😄 To display
Then your |
@Szayet Thank you for helping. I followed your comments to get me out of a tough spot. Though my code is working now, I just cant get the error message to display the correct message. Please check my code and tell me where I am going wrong.
I keep getting "issuedShares is invalid" as error message instead of "Number of shares issued cannot exceed share cap" as required from
|
@nosizejosh Hello, recently I fall into the same problem. And I have solved it in fork way. Maybe it can helps somebody. |
I had a similar problem, I wanted to replace the built-in errors with translated versions:
Most code is taken from the messagebox defaults. I wonder how this works: https://github.com/aldeed/node-simple-schema/blob/2b8f902e0d8d84eb923f9cf0cca2124f03f41cf8/lib/testHelpers/testSchema.js#L171 |
https://github.com/aldeed/node-simple-schema#customizing-validation-messages This was not very well documented until yesterday, but I'm pretty sure there's no actual issue here. If I'm wrong, I can reopen this. |
@aldeed I am using this for my meteor project and I have migrate from meteor package to this node_module package together with collection-2-core package.
Currently I want to customize the validation messages for regEx because all error message for regEx is just "failed regular expression validation", and I would like to give a more clear validation message such as "must contain at least 1 digit" etc.
However, I couldn't find a correct way/clear example to do it. I checked the message-box package and still don't know how to do it, and I found the documentation a bit confusing :
import MessageBox from 'message-box';
should be included in the Usage.It shows me messageBox is undefined even if I have imported both simpleschema and message-box npm packages.
I tried to customize with the code below:
But it is not working. I understand that it is still in progress, but would be nice to add a clear example on customize validation messages for regEx. Thank you!
The text was updated successfully, but these errors were encountered: