colinaut / alpinejs-plugin-simple-validate

Simple Alpine form validation plugin
97 stars 4 forks source link

When using multiple forms with some same fields the validation error-msg is shown on load #9

Closed kevinmu17 closed 1 year ago

kevinmu17 commented 1 year ago
<form x-data x-validate @submit="$validate.submit">
    <div>
        <input type="email" name="testing" required>
        <div class="error-msg text-sm mt-2 text-red-600">
            E-mailadres is required
        </div>
    </div>
    <button type="submit">send</button>
</form>
<form x-data x-validate @submit="$validate.submit">
    <div>
        <input type="email" name="testing" required>
        <div class="error-msg text-sm mt-2 text-red-600">
            E-mailadres is required
        </div>
    </div>
    <button type="submit">send</button>
</form>
Screenshot 2023-05-13 at 14 44 59
colinaut commented 1 year ago

Thanks for finding this error! Sorry for the delay but I've been bury with other work. I just fixed this issue in the new 1.7.17 release.

kevinmu17 commented 6 months ago

Hi @colinaut This problem is back :(

I'm using v 1.7.23

colinaut commented 6 months ago

Ok sorted out the issue. It was searching for the error from the document level and not the form level. Fixed in 1.7.24.