Re: Validation problem

2014-02-11 Thread Slawomir Wawak
It started to work, however I still don't know why. ;-)
Well, beginnings are difficult... 
Thanks for help.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Re: Validation problem

2014-02-10 Thread Slawomir Wawak
Thanks a lot. This
 

> $this->Student->set($this->request->data)
>

helped. Now most of the fields are being validated. Only two left:

'password' => array(
> 'rule'=> array('minLength', '6'),
> 'required'=>true,
> 'message' => 'Co najmniej 6 znaków'
> ), 
> 'moodle_password' => array(
> 'rule'=> array('equalTo', 'some_text'),
> 'required'=>true,
> 'message' => 'Błędne hasło Moodle'
> ),
>

Both don't validate. I don't know why. :-(

Regards,
Slawek.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.


Validation problem

2014-02-10 Thread Slawomir Wawak
Hi!
I try to create some validation to my form. I followed some forums and 
blogs looking for solution, but nothing helps.

My controller looks like this:

public function add() {
> if ($this->request->is('post')) {
> $this->Student->create();
> *if ($this->Student->validates()) {*
> .
>

And my model validation:

public $validate = array(
>>  'firstname' => array(
>> 'alphaNumeric' => array(
>> 'rule' => 'alphaNumeric',
>> 'required'=>true,
>> 'message'  => 'Tylko litery w imieniu'
>> ),
>> 'minLength' => array(
>> 'rule'=> array('minLength', '3'),
>> 'required'=>true,
>> 'message' => 'Wpisz pełne imię'
>> )
>> ), ..
>
>
When I remove "required => true" form passes validation even with errors! 
When I enable "required => true" form fails each time, even when correct. 
The only field that works correct is email:

> 'email' => array('email', true),
>

When I show debug($this->Student->data) all data is there. However I 
suppose, that somehow validation may be somehow unable to see this. 

Please help me find solution to this problem.
Regards,
Slawek.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.