How to add validation to the ListboxButton during the form submit? Native Form validation for the Headless ui #2717
Unanswered
Aravinda93
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, when I submit the form I am unable to add validation to the
ListBoxButton
from headless UI. I am able to validate other simple fields such as Input text, Select Dropdown, etc but the headlessUI ListboxButton does not support form validation.I am using the headless UI in my Nuxt 3 application as follows:
components/Dropdown.vue:
Its usage in pages/Test.vue:
Currently I am able to submit my form without even selecting any value for the Dropdown. How to prevent it? If I use the Select dropdown then everything works fine but I want to use the ListBoxButton from headless ui for better appearance of the application.
Beta Was this translation helpful? Give feedback.
All reactions