On Jul 21, 1:12 pm, moment11 <[EMAIL PROTECTED]> wrote:
> In my model (Hvbasicinfo), I have arrays:
>
>     [Name] => Array
>         (
>             [First] => Karen
>             [Last] => Kerry
>         )
>     [Gender] => Female
>
> Validating Gender is simple with a rule like:
>
>         'Gender' => array('rule' => VALID_NOT_EMPTY,'required' =>
> true, 'message' => 'Gender required.'),
>
> But in my edit form, I have fields for First and Last of the Name
> array.
>
> I want both to be non-empty.
>
> Rendering the fields on the form is simple:
>
>  echo $form->text('Hvbasicinfo.Name.First', array('type' => 'text',
> 'size' => '20'))
>
> But I can't figure out the syntax for how to do that. Or if it is even
> possible?

Is name a related model?  What does the table for Hvbasicinfo look
like?
Having name as an array is quite unusual unless it is a related
model.  Normally I would make fields called first_name and last_name.
If that is how your table is built try Hvbasicinfo.first_name and
Hvbasicinfo.last_name.

-Mark
--~--~---------~--~----~------------~-------~--~----~
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