I always use backend validation(if there is a backend). I do this to streamline my validation checks and to avoid duplicating and missing some validation on the frontend. It’s my personal best practice regarding validation. It goes against bootstrap recommendation, but I have my personal opinion on this.
However this doesn’t mean that error message handling in the frontend can’t take advantage of this approach without duplicating on the client side the validation.
Would it be possible to improve the functionality so that the condition that is being checked in the backend is sent to the frontend to make the message disappear once the condition is met?
My use case:
I have a form that validates some fields in the backend on submit. Error messages will be shown correctly in the form. But if I correct the fields the messages will not disappear until a new submit which causes confusion on the end user. Thus why it’s a UX improvement.
This confusion could be avoided if the condition was checked in the backend but also sent to the frontend in the response. This way the frontend could monitor the input to check if the condition is now met before submitting and remove the is-invalid feedback.
I believe it’s not standard for Bootstrap, but it could be a nice UX improvement provided by Wappler.
Last updated: