Here are my model rules..

                'tin' => array(
                        //removed because not alll providers will have TIN
                        'notempty' => array(
                                'rule' => array('notempty'),
                                'message' => 'Please provide a Tax ID for your 
organization.',
                                'allowEmpty' => false,
                                'required' => true,
                                'last' => true, // Stop validation after this 
rule
                                //'on' => 'create', // Limit validation to 
'create' or 'update'
operations
                        ),
                        'ssn' => array(
                                'rule' => array('ssn', null),
                                'message' => 'The Tax ID must be 9 characters 
long (excluding -)',
                                'last' => true

                        ),
                ),
                'name' => array(
                        'notempty' => array(
                                'rule' => array('notempty'),
                                'message' => 'Please provide a Legal 
Organization Name',
                                'allowEmpty' => false,
                                'required' => true,
                                'last' => true

                        )
                ),
                'address' => array(
                        'notempty' => array(
                                'rule' => array('notempty'),
                                'message' => 'Please enter one line for 
address',
                                'allowEmpty' => false,
                                'required' => true,
                                'last' => true
                        )
                ),

                'countries_id' => array(
                        'notempty' => array(
                                'rule' => array('notempty'),
                                'message' => 'Please select Country',
                                'allowEmpty' => false,
                                'required' => true,
                                'last' => true
                        )
                ),
                'states_id' => array(
                        'notempty' => array(
                                'rule' => array('notempty'),
                                'message' => 'Please select State',
                                'allowEmpty' => false,
                                'required' => true,
                                'last' => true
                        )
                ),
                'cities_id' => array(
                        'notempty' => array(
                                'rule' => array('notempty'),
                                'message' => 'Please select City',
                                'allowEmpty' => false,
                                'required' => true,
                                'last' => true
                        )
                ),
                'zip' => array(
                        'notempty' => array(
                                'rule' => array('notempty'),
                                'message' => 'Please select Zip',
                                'allowEmpty' => false,
                                'required' => true,
                                'last' => true
                        )
                )
        );

Is it being caused by the required/allowEmpty combo?

On Jan 13, 10:32 am, rgreenphotodesign <rgr...@rgreenphotography.com>
wrote:
> I'm working on validation between two model model1 hasMany model2. I
> have a two step process where in the end users first view they need to
> enter a subset of data for both model1 & 2. Once this is complete,
> they're then allowed to complete the entire process which includes
> additional data for each model that needs to be validated at that
> point.
>
> First step in my process:
>
> First view contains a name field for model1 and a username for model2.
> Sent to model1 controller. In the controller I'm doing the following
>
> $this->Model1->set($this->data);
> if($this->Model1->validates(array('fieldList' => array('name')))) {
> //perform save with validate set to false
>
> }
>
> with or without the fieldList is looks to be generating the same
> results. All validation rules are processed for the model. In the
> process of testing I've eliminated model2 from the equation because I
> can't get model1 to work. Ultimately I'd like to be able to choose a
> subset of rules for both model 1 & 2 in this process. If I'm
> understanding correctly $this->Model->saveAll($this->data,
> array('validate' => 'only')) would still execute all validation rules.
>
> Any ideas on why even on the basic example why the fieldList isn't
> working? Am I missing something?
>
> I'm on Cake 1.3.

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to