in my opinion you have to...

thats because the logic of your validation rule does not always match
the result cake puts in the form fields in the view (adding class
"required")
you can check that out by adding a style to "required" like
"background-color: red"

its pretty messed up
some fields are not "required" which should be and vise versa

i did it this way:
add

if (!empty($options['required'])) {
                                $divOptions = $this->addClass($divOptions, 
'required');
                        }

in the helper function "input()"

add "required => true" in the attributes of $form->input() in the
view, where you need it

now you can either use CSS or Jquery to add your asterisk (jquery
works even in old IE6 browsers etc)


this is neccessary due to the fact that "required => true/false" in
the model has a different meaning than you would expect - and in some
views this field may be required, in some not
so what other way would be there to have the flexibility I have?



On 30 Jul., 11:24, Taff <[email protected]> wrote:
> Hey,
> there is so much functionality in cakePHP, but how would I go about
> adding an asterisk (as text) to all required fields? It's seldom you
> have a form without a required field, so I'm presuming it's possible
> without hacking into the helper.php. Unfortunately I can't see where.
>
> Thanks,
> Taff
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to