Re: Where is the problem in my validations

2010-07-30 Thread Tilen Majerle
emm...error is non correct closed brackets of array
--
LP,
Tilen Majerle http://majerle.eu


2010/7/30 Master Ram...! ramganga...@gmail.com



 in the view :

 ?php
 if(! empty($message)) {

 echo div class=\success\.$message./div;
 }

 if($form-isFieldError('Model_Name.field_name')) {

 e($form-error ('Model_Name.field_name',
 null,
 array(
 'class' = 'failure')));
 }
 ?



 in the model you can use this.

 var $validate = array(

 'email' = array(
 'rule1' = array(
'rule' = 'notEmpty',
'required' = true,
'allowEmpty' = false,
'message' = 'Please enter a
 value for the Email field',
 'last' = true),
 'rule2' = array(
 'rule' = 'email',
 'message' = 'Please enter a
 proper Email Id'
 ),
   'unique' = array(
   'rule' = array('checkUnique',
 'email'),
   'message' = 'A user with this email
 address already exists, please try again.'
)),


 'password' = array(
 'notempty' = array(
   'rule' = 'notEmpty',
'required' = true,
'allowEmpty' = false,
'message' = 'Confirm
 Password cannot be empty',
 'last' = true
  ),
 );


  function checkUnique ($data, $fieldName) {

 $valid = false;

 if ( isset($fieldName)  $this-hasField($fieldName)) {

 $valid = $this-isUnique(array($fieldName = $data));
 }

 return $valid;
 }

 good luck..


















 On Thu, Jul 29, 2010 at 10:22 PM, euromark dereurom...@googlemail.comwrote:

 you might wanna re-read Tilen Majerle's answer...


 On 29 Jul., 18:25, CakeMan narula.vi...@gmail.com wrote:
  Well, Validations are working perfectly (giving error message) except
  that error in 2571 line with this NonEmpty ??? Strange ??
 
  On Jul 29, 1:12 pm, Tilen Majerle tilen.maje...@gmail.com wrote:
 
 
 
   yes, u have itit is not NonEmpty but is notEmpty xD
   --
   LP,
   Tilen Majerlehttp://majerle.eu
 
   2010/7/29 CakeMan narula.vi...@gmail.com
 
Hi,
 
Is there any problem with this Validation array in my model :
 
var $validate=array
(
 'email'= array
 (
 
 'rule'='NonEmpty',
 
 'message'='Please provide valid Email.'
   
),
  'password'= array
  (
 
'rule' ='NonEmpty',
 
'message'='Please provide Password.'
   
 )
   );
 
it is giving me error as below :-
Warning (2): preg_match() [function.preg-match]: Delimiter must not
 be
alphanumeric or backslash [CORE\cake\libs\model\model.php, line
 2571]
 
I am using Cake1.3
 
Please help
 
Thanks
 
Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp
 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.comcake-php%2bunsubscr...@googlegroups.com
 cake-php%2bunsubscr...@googlegroups.c omFor more options, visit this
 group at
   http://groups.google.com/group/cake-php?hl=en

 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.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en




 --
 Master Ram.
 Founder n Director of rgPlanets Pvt. Ltd.

  Check out the new CakePHP Questions site 

Re: Where is the problem in my validations

2010-07-29 Thread Tilen Majerle
yes, u have itit is not NonEmpty but is notEmpty xD
--
LP,
Tilen Majerle http://majerle.eu


2010/7/29 CakeMan narula.vi...@gmail.com

 Hi,

 Is there any problem with this Validation array in my model :

 var $validate=array
 (
  'email'= array
  (

  'rule'='NonEmpty',

  'message'='Please provide valid Email.'
),
   'password'= array
   (

 'rule' ='NonEmpty',

 'message'='Please provide Password.'
 )
);



 it is giving me error as below :-
 Warning (2): preg_match() [function.preg-match]: Delimiter must not be
 alphanumeric or backslash [CORE\cake\libs\model\model.php, line 2571]

 I am using Cake1.3

 Please help

 Thanks

 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.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en


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


Re: Where is the problem in my validations

2010-07-29 Thread CakeMan
Well, Validations are working perfectly (giving error message) except
that error in 2571 line with this NonEmpty ??? Strange ??

On Jul 29, 1:12 pm, Tilen Majerle tilen.maje...@gmail.com wrote:
 yes, u have itit is not NonEmpty but is notEmpty xD
 --
 LP,
 Tilen Majerlehttp://majerle.eu

 2010/7/29 CakeMan narula.vi...@gmail.com

  Hi,

  Is there any problem with this Validation array in my model :

  var $validate=array
                                  (
                                   'email'= array
                                                                   (

   'rule'='NonEmpty',

   'message'='Please provide valid Email.'
                                                                         ),
                                    'password'= array
                                                                    (

  'rule' ='NonEmpty',

  'message'='Please provide Password.'
                                                                          )
                                         );

  it is giving me error as below :-
  Warning (2): preg_match() [function.preg-match]: Delimiter must not be
  alphanumeric or backslash [CORE\cake\libs\model\model.php, line 2571]

  I am using Cake1.3

  Please help

  Thanks

  Check out the new CakePHP Questions sitehttp://cakeqs.organd 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.comcake-php%2bunsubscr...@googlegroups.comFor
   more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en

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


Re: Where is the problem in my validations

2010-07-29 Thread euromark
you might wanna re-read Tilen Majerle's answer...


On 29 Jul., 18:25, CakeMan narula.vi...@gmail.com wrote:
 Well, Validations are working perfectly (giving error message) except
 that error in 2571 line with this NonEmpty ??? Strange ??

 On Jul 29, 1:12 pm, Tilen Majerle tilen.maje...@gmail.com wrote:



  yes, u have itit is not NonEmpty but is notEmpty xD
  --
  LP,
  Tilen Majerlehttp://majerle.eu

  2010/7/29 CakeMan narula.vi...@gmail.com

   Hi,

   Is there any problem with this Validation array in my model :

   var $validate=array
                                   (
                                    'email'= array
                                                                    (

    'rule'='NonEmpty',

    'message'='Please provide valid Email.'
                                                                          ),
                                     'password'= array
                                                                     (

   'rule' ='NonEmpty',

   'message'='Please provide Password.'
                                                                           )
                                          );

   it is giving me error as below :-
   Warning (2): preg_match() [function.preg-match]: Delimiter must not be
   alphanumeric or backslash [CORE\cake\libs\model\model.php, line 2571]

   I am using Cake1.3

   Please help

   Thanks

   Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp 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.comcake-php%2bunsubscr...@googlegroups.c
omFor more options, visit this group at
  http://groups.google.com/group/cake-php?hl=en

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


Re: Where is the problem in my validations

2010-07-29 Thread Master Ram...!
in the view :

?php
if(! empty($message)) {

echo div class=\success\.$message./div;
}

if($form-isFieldError('Model_Name.field_name')) {

e($form-error ('Model_Name.field_name',
null,
array(
'class' = 'failure')));
}
?



in the model you can use this.

var $validate = array(

'email' = array(
'rule1' = array(
   'rule' = 'notEmpty',
   'required' = true,
   'allowEmpty' = false,
   'message' = 'Please enter a
value for the Email field',
'last' = true),
'rule2' = array(
'rule' = 'email',
'message' = 'Please enter a
proper Email Id'
),
  'unique' = array(
  'rule' = array('checkUnique',
'email'),
  'message' = 'A user with this email
address already exists, please try again.'
   )),


'password' = array(
'notempty' = array(
  'rule' = 'notEmpty',
   'required' = true,
   'allowEmpty' = false,
   'message' = 'Confirm
Password cannot be empty',
'last' = true
 ),
);


 function checkUnique ($data, $fieldName) {

$valid = false;

if ( isset($fieldName)  $this-hasField($fieldName)) {

$valid = $this-isUnique(array($fieldName = $data));
}

return $valid;
}

good luck..

















On Thu, Jul 29, 2010 at 10:22 PM, euromark dereurom...@googlemail.comwrote:

 you might wanna re-read Tilen Majerle's answer...


 On 29 Jul., 18:25, CakeMan narula.vi...@gmail.com wrote:
  Well, Validations are working perfectly (giving error message) except
  that error in 2571 line with this NonEmpty ??? Strange ??
 
  On Jul 29, 1:12 pm, Tilen Majerle tilen.maje...@gmail.com wrote:
 
 
 
   yes, u have itit is not NonEmpty but is notEmpty xD
   --
   LP,
   Tilen Majerlehttp://majerle.eu
 
   2010/7/29 CakeMan narula.vi...@gmail.com
 
Hi,
 
Is there any problem with this Validation array in my model :
 
var $validate=array
(
 'email'= array
 (
 
 'rule'='NonEmpty',
 
 'message'='Please provide valid Email.'
   
  ),
  'password'= array
  (
 
'rule' ='NonEmpty',
 
'message'='Please provide Password.'
   
   )
   );
 
it is giving me error as below :-
Warning (2): preg_match() [function.preg-match]: Delimiter must not
 be
alphanumeric or backslash [CORE\cake\libs\model\model.php, line 2571]
 
I am using Cake1.3
 
Please help
 
Thanks
 
Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp
 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.comcake-php%2bunsubscr...@googlegroups.com
 cake-php%2bunsubscr...@googlegroups.c omFor more options, visit this
 group at
   http://groups.google.com/group/cake-php?hl=en

 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.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en




-- 
Master Ram.
Founder n Director of rgPlanets Pvt. Ltd.

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