Re: how to validate form data

2010-08-04 Thread Miqdad Ali
array(
'userModel' => 'Login',
'userKey' => 'user_id',
'description_ids' => true

   ));
var $hasOne= array(
 'StdDetail'=>array(
 'foreignKey'=>false,
 'ClassName'=>'StdDetail'
   )
  );
var $validate = array(

  'name' => array(
  'rule' =>
array('custom','/^[A-Z -.]{1,}$/i'),
  'required' => true,
  'message' => 'Please choose
qualifying exam'

   ),
'institute' => array(
  'rule' =>
array('custom','/^[A-Z -.]{1,}$/i'),
  'required' => true,
  'message' => 'Please enter
Alphabetic values'
   ),
 'board' => array(
  'rule' =>
array('custom','/^[A-Z -.]{1,}$/i'),
  'required' => true,
  'message' => 'Please enter
Alphabetic values'
   ),

'max' => array(
  'rule' =>
array('custom','/^[0-9]{1,}$/i'),
  'required' => true,
  'message' => 'Enter a numerica
value'
   ),
'total' => array(
  'rule' =>
array('custom','/^[0-9]{1,}$/i'),
  'required' => true,
  'message' => 'Enter a numerica
value'
   ),
 'chem' => array(
  'rule' =>
array('custom','/^[0-9]{1,}$/i'),
  'required' => true,
  'message' => 'Enter a numerica
value'
   ),
 'phy' => array(
  'rule' =>
array('custom','/^[0-9]{1,}$/i'),
  'required' => true,
  'message' => 'Enter a numerica
value'
   ),
 'math' => array(
  'rule' =>
array('custom','/^[0-9]{1,}$/i'),
  'required' => true,
  'message' => 'Enter a numerica
value'
   ),


'aggregate' => array(
  'rule' =>
array('custom','/^[0-9]{1,}$/i'),
  'required' => true,
  'message' => 'Enter a numerica
value'
   ),
'memo' => array(
  'rule' =>
array('custom','/^[0-9]{1,}$/i'),
  'required' => true,
  'message' => 'Enter a numerica
value'
   ),
'rank' => array(
  'rule' =>
array('custom','/^[0-9]{1,}$/i'),
  'required' => true,
  'message' => 'Enter a numerica
value'
   )
   /* 'max' => array(
  'rule' =>
array('custom','/^[0-9]{1,}$/i'),
  'required' => true,
  'message' => 'Enter a numerica
value'
   ),
'total' => array(
  'rule' =>
array('custom','/^[0-9]{1,}$/i'),
  'required' => true,
  'message' => 'Enter a numerica
value'
   ),
'chem' => array(
  'rule' =>
array('custom','/^[0-9]{1,}$/i'),
  'required' => true,
  'message' => 'Enter a numerica
value'
  

Re: how to validate form data

2010-08-04 Thread Miqdad Ali
array(
'userModel' => 'Login',
'userKey' => 'user_id',
'description_ids' => true

   ));

var $validate = array(

  'name' => array(
  'rule' =>
array('custom','/^[A-Z -.]{1,}$/i'),
  'required' => true,
  'message' => 'Please choose
qualifying exam'

   )
);
}
?>
This is My Model  An It's Working Fine
But , I want to change the color of message while it's displaying.





On Wed, Aug 4, 2010 at 1:43 PM, xiaopang  wrote:

> Hello,
>
> If I want to validate the form input, let's see if it is a email and I
> don't need to store this input in to database, which means the
> $validate array can't do the validation.
>
> In this case, besides writing reg express, does cakephp provide any
> validation mechanism?
>
> 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.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: how to validate form data

2010-08-04 Thread grigri
You are incorrect in your assumption; you can validate a field with
the $validate array, even if it's not in the database.

This is most often used for "I agree" checkboxes and whatnot, but it
works with anything.

hth
grigri

On Aug 4, 9:13 am, xiaopang  wrote:
> Hello,
>
> If I want to validate the form input, let's see if it is a email and I
> don't need to store this input in to database, which means the
> $validate array can't do the validation.
>
> In this case, besides writing reg express, does cakephp provide any
> validation mechanism?

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


how to validate form data

2010-08-04 Thread xiaopang
Hello,

If I want to validate the form input, let's see if it is a email and I
don't need to store this input in to database, which means the
$validate array can't do the validation.

In this case, besides writing reg express, does cakephp provide any
validation mechanism?

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