Is there a way to test if a particular text field has an error so that i can add a Class to highlight the who text box
<div class="form-group">
<?php echo $this->Form->label('name', 'Name:', array('class' => 'col-sm-2 control-label')); ?>
<div class="col-sm-10">
<?php echo $this->Form->text('name', array('required' => false, 'class' => 'form-control input-lg')); ?>
<?php echo $this->Form->error('name', null, array('class' => 'label label-block label-danger text-left', 'wrap' => 'label')); ?>
</div>
</div>
i want to add has-error
to <div class="form-group">
div if name
has any errors