Hey, so new to this plugin and it's working great so far. Thanks for your work on this. I have a bit of a special use case - not sure if this has been talked about before. But, in the case of a <select> element, I'm rendering a set of <div> elements over it to allow for better UI styling. So via Alpine, I'm controlling the set value of the <select> element by binding it to a model via x-model which is ultimately controlled by interacting with the enhanced <div> elements.
In this case, the validation seems to work, however, when a value is finally selected, it's not removing the dynamically added data-error attributes from the elements it appends them to, so it looks like there is still an error. However, even though it doesn't remove them, the value of the select element is correctly set, the validation does pass and the form submits. Am I perhaps missing a step in this scenario to get the error attributes to clear out?
Here's the code and some screenshots of what I'm working with right now (the select element is hidden via CSS.) Let me know if you might have any insight to this of if what I'm trying to do is possible. TIA!
Hey, so new to this plugin and it's working great so far. Thanks for your work on this. I have a bit of a special use case - not sure if this has been talked about before. But, in the case of a
<select>
element, I'm rendering a set of<div>
elements over it to allow for better UI styling. So via Alpine, I'm controlling the set value of the<select>
element by binding it to a model viax-model
which is ultimately controlled by interacting with the enhanced<div>
elements.In this case, the validation seems to work, however, when a value is finally selected, it's not removing the dynamically added
data-error
attributes from the elements it appends them to, so it looks like there is still an error. However, even though it doesn't remove them, the value of the select element is correctly set, the validation does pass and the form submits. Am I perhaps missing a step in this scenario to get the error attributes to clear out?Here's the code and some screenshots of what I'm working with right now (the select element is hidden via CSS.) Let me know if you might have any insight to this of if what I'm trying to do is possible. TIA!
Data Error Attributes
Error Focus - Value Not Set
Error Focus - Value Set - Error Attributes Don't Clear
Select Value is Set; Submission Works