You can place some fields that are actually not in the model in the
validate array. The problem with your case, it that you do not have a
definite limit.
There is an option you can set in the $validate  ..  'on' => 'create'
and 'on' => 'update' associated with the array (same level as 'rule').
I have seen it in the code of validation.php in the cake1.2 branch and
it relies on the definition of $id in the $this->data of the
Model ..maybe it's on way (but really never tried it)...

On Aug 7, 1:19 am, nagarjuna <[EMAIL PROTECTED]> wrote:
> Thanks for the advice.  Unfortunately this will not work for me
> because it chokes on:
>
> $this->Mark->invalidate('mark_number'.$i, "Mark already exists);
>
> I have two types of marks for input (NewMarks and ExistingMarks), and
> they are stored in the data matrix under $this->data['NewMarks'] not
> under $this->data['Marks'].
> So with the above statement, cake tries to look for the variable
> data['Marks'] and invalidate it and I get the error message
>
> Undefined property:  ObservationsController::$Mark [CORE\app
> \controllers\observations_controller.php, line 134]
>
> Is there any way to invalidate a field directly in the controller if
> the field is not attached to any model field?
> For example, is there anyway to access the form helper directly in the
> controller a.la.
> $this->form->error('NewMarks'.'mark_number'.$i, "Mark already
> exists" );
>
> The above won't work, but you get the idea.  By the way, I am using
> the formHelper and validation from 1.2


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
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