setting it in the options array of your $form->input call:
$form->input('field', array('error' => array('class' => 'custom-error-
class')));
Or you could take the automatic error out of the input div and put it
on its own where you have more control:
<?php echo $form->input('field', array('error' => false));?>
<div class="error-message'><?php echo $form->error('field', array
('class' => 'nested-div'));?></div>
-Corie
On Feb 28, 11:15 pm, horatio <bnab...@says.mu> wrote:
> two questions--
>
> the default class returned from error() within the html helper is
> error-message. how do i override this in my controller?
>
> more importantly, how can i inject some html content inside the error div
> after a failed form validation?
>
> right now its:
>
> <div class="error-message">error message here</div>
>
> i would like it to hypothetically be:
>
> <div class="error-message"><div class="nested-div">error message
> here</div></div>
>
> is this possible sanely?
>
> --
> View this message in context:http://www.nabble.com/customizing-error-messages-from-form-helper-tp2...
> Sent from the CakePHP mailing list archive at Nabble.com.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---
No comments:
Post a Comment