Color label with addConditionOn
Notice: This thread is very old.
- richard
- Member | 60
Hello,
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');
?>