Color label with addConditionOn

Notice: This thread is very old.
richard
Member | 60
+
0
-

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');
?>
Jan Tvrdík
Nette guru | 2595
+
0
-

You can use javascript to do that.