Best way to validate select list while also using an onselectionchange event #5738
Replies: 2 comments 1 reply
-
Validation fields usually all work separately, on their own. While you can hack it a little, it is not how it was designed so it will never be perfect. The only way I can think of that could help you to achieve to be "aware" of other fields is to use See the code in our demo for reference https://github.com/Megabit/Blazorise/blob/master/Demos/Blazorise.Demo/Pages/Tests/ValidationsPage.razor#L764 PS. By overriding
On a TextEdit you're basically skipping TextEdit internal logic and validation process. |
Beta Was this translation helpful? Give feedback.
-
I think the challenge that I have is that I only want to set my flag when the value has changed, but I always want to validate. I'm not sure how the custom validator would help in that case. The custom validator link you send me is useful for other things. Here is my use case: With that use case, what would be the best approach for the select list? All of the other validations on the page are working fine. |
Beta Was this translation helpful? Give feedback.
-
We have a need to reset a flag on field change for downstream validation. We use the following code for text boxes to update our internal flag. This works fine and doesn't interfere with validation. However, when we use the same onchange/oninput events on the select list, validation always fails. Switching the select box over to onselectionchanged does not actually seem to fire the event but validation works. What's the best way to be able to validate with a select box while being able to handle an additional call to the onchange?
This it the method being called. It's more of a test method right now with other code waiting to be implemented.
Beta Was this translation helpful? Give feedback.
All reactions