4 Answers, 1 is accepted
Thanks in advice, Vlad
Hi Vlad,
What I can suggest is to create a function that will receive the validators and return a combination of the messages that they display. I've created an example to showcase how this can be achieved, enter 'test' to see how both validation messages appear:
https://stackblitz.com/edit/react-multiple-validators?file=app/main.jsx
If you would like to have this as a feature, you can submit a feature request here. We can also do that for you if you prefer us to do it. The feature will be planned based on community interest.
Hope this is helpful.
Regards,
Krissy
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.
Hi Vlad,
In regards to the EmailInput always refreshing, I was able to avoid that by making two changes to the previous example:
- I combined the validator outside of the render of the component, otherwise it creates a new array every single time and that makes the form continously re-render
- Optional: Instead of using an array, all validation messages are combined into a single one with a particular symbol used as a separator. The string is then split where that separator is, and a new array is achieved.
https://stackblitz.com/edit/react-multiple-validators-9bxev2?file=app/main.jsx
Hope this is helpful.
Regards,
Krissy
Progress Telerik
Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.