Thanks John,

Good looking out! I will add that since its more cake-ish than my current
setup with the after method.

Thanks again for your time and sorry for the confusion :)

Dave 

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf
Of John Andersen
Sent: January-05-10 2:45 PM
To: CakePHP
Subject: Re: Error Placement / Styles

Hi Dave,

I did understand that your hint was - a hint to the user - but I assumed
that you would find out how to include that together with the form field
definition :)

Using the form helper, I would just add the "after" option to include
something after the entry field. Using your hint code, I get the following
HTML code.

[code]
<div class="input text"><label for="ReporterEmail">E-mail</
label><input name="data[Reporter][email]" type="text" class="email"
maxlength="128" value="" id="ReporterEmail" /><p class="form_hint"><span
class="bold red">Required:</span>Password must be minimum of 8
characters.</p></div> [/code]

As you can see, your hint is placed after the input tag. This is all done,
just by using the form helper.

My form helper code for the above is then:

[code]
print( $form->input( 'Reporter.email', array('label' => __
('visitors_email',true), 'class' => 'email', 'error' => array
('report_email_rule' => __('report_email_rule',true) ), 'after' => '<p
class="form_hint"><span class="bold red">Required:</span>Password must be
minimum of 8 characters.</p>' ) ) ); [/code]

If you don't want the error message to show up, just define it as " "
- a blank ;)

Well, if you can use it, good, else good that your solution is working also!
Enjoy,
   John

On Jan 5, 7:57 pm, "Dave" <[email protected]> wrote:
> Thanks,
>
> This works perfect.
> <li <?php if($form->error('User.password')){?> class='error''<?php }?> 
> > </li>
>
> After re-reading Johns email I think i gave the impression that the 
> hint was the error message. That is where I may have causeed some 
> confusion. The hint is always visible, its not an error message. 
> Imagine a field  called "User.specialty" and the hint was "Please 
> describe briefly your background in this area". It only provides a hint to
the user as to what info to enter.
> Then if they skip that field I then display my error "Please enter 
> your Specialty"....or what not
>
> Thanks guys,
>
> Dave
>
[snip]

No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.725 / Virus Database: 270.14.124/2599 - Release Date: 01/05/10
04:05:00

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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