change opacity of submit button when all required field validated #3636
Unanswered
combaudouo
asked this question in
Help
Replies: 1 comment 1 reply
-
Since opacity doesn't have // tailwind.config.js
{
...
variants: {
extend: {
opacity: ['disabled']
},
},
} |
Beta Was this translation helpful? Give feedback.
1 reply
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.
-
Hi, I am pretty new (and not very good basically) to Tailwind and i am trying to find a way to change the opacity of the submit button of a form depending whether all required fields in the form are filled or not.
I have an input field which is required:
<input type="radio" name="cordee" id="{{ $cordee->id }}" class="hidden" required>
And I have a submit button with disabled:opacity-50:
<button type="submit" form="select_cordee" class="flex-none px-4 bg-indigo-500 disabled:opacity-50 rounded-lg text-white hover:bg-indigo-400">{{ __('ascent.start') }}</button>
But it does not work. I have tried to do something with a custom variant but as i said, I am not very good, so I don't really find my way. Is there a easier solution ?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions