Closed VicoErv closed 6 years ago
Hello @Mevrael In my case, i have form in modal dialog for add / edit user data, when i input that violated validation it show error. and then i want to clear the error after modal dialog is hidden. my temporary solution is remove error element that generated by this library manually
Hi @VicoErv
I believe you had a great weekend and sorry for delay.
Well, if you just want to remove error messages, you can Validation.ui.removeErrorNodesFromSection(HTMLElement node)
https://github.com/Mevrael/bunny/blob/master/src/Validation.js#L441
(P.S. at some point I plan to rename Validation.ui to Validation.UI, so probably at that point it would be better for you to import and use ValidationUI object itself.)
However, in that case I suppose you also would need to clear all inputs you have in this modal, otherwise, input might be filled with wrong value, but you would just remove error message and leave user alone with small UX question.
Usually, you also keep state of the modal forms as they were in case user would accidentally close it or just would like to continue a bit later. It's nice to see that you didn't lose your work.
Please let me know if would have any further comments or questions.
Hi @VicoErv
I believe you are well.
Thank you for your question. Could you please tell me a bit more about a use case and how exactly it should work in your opinion?