mercredi 6 juillet 2022

Symfony read only checkbox checked

I'm looking for a way to disable text input validation and readOnly the TextType if the box is checked?

$formBuilder
            ->add('text',      TextType::class,array(
            'required' => true,
            'constraints' => array(
                new NotBlank()
            )))
            ->add('box',      CheckboxType::class, array(
                'mapped' => false,
                'label' => 'Box'
            ))

    ;



Aucun commentaire:

Enregistrer un commentaire