We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I want to add a new class required to input filed but it was not working as expected, there is no required class is added to input field.
required
->add('del_flg', Field::CHOICE, [ 'label' => '削除状態', 'choices' => ['0' => '有効', '1' => '削除済'], 'expanded' => true, 'multiple' => false, 'attr' => ['class' => 'required'], 'choice_options' => [ 'wrapper' => ['class' => 'choice-wrapper'], 'label_attr' => ['class' => 'required label-class'], ], ])
The text was updated successfully, but these errors were encountered:
have you tried to add it to 'choice_options'?
All you need to do is to move that class config one step up:
class
->add('del_flg', Field::CHOICE, [ 'label' => '削除状態', 'choices' => ['0' => '有効', '1' => '削除済'], 'expanded' => true, 'multiple' => false, 'class' => 'required', 'choice_options' => [ 'wrapper' => ['class' => 'choice-wrapper'], 'label_attr' => ['class' => 'required label-class'], ], ])
also required class is added when field has required validation rule set
Sorry, something went wrong.
No branches or pull requests
I want to add a new class required to input filed but it was not working as expected, there is no
required
class is added to input field.The text was updated successfully, but these errors were encountered: