Notice: This thread is very old.
- Member | 60
with the below example, could I somehow assign class ‘required’ to the label of email input when a condition is met? Or I need to hack around?
<?php $form->addCheckbox('newsletters', 'send me newsletters'); $form->addText('email', 'Email:') ->addConditionOn($form['newsletters'], Form::EQUAL, TRUE) ->addRule(Form::FILLED, 'Fill your email address'); ?>