<?php
class Mark extends AppModel{
var $name = 'Mark';
var $actsAs = array('Logable'=>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'
),
'phy' => 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'
),
'mat' => array(
'rule' =>
array('custom','/^[0-9]{1,}$/i'),
'required' => true,
'message' => 'Enter a numerica
value'
),
'name' => array(
'rule' =>
array('minlength',1),
'required' => true,
'message' => 'Please choose
qualifying exam'
),
/*'year' => array(
'rule' =>
array('custom','/^[0-9]{1,}$/i'),
'required' => true,
'message' => 'Please choose
year of passout'
),*/
/*'institute' => array(
'rule' =>
array('minlength',1),
'required' => true,
'message' => 'Please select an
institute'
),
'board' => array(
'rule' =>
array('minlength',1),
'required' => true,
'message' => 'Please select an
board'
)*/
);
}
?>
This is The full code of my model ......
then I want to change the color of message while displaying..
--------------------------------------------------------------------
On Wed, Aug 4, 2010 at 3:09 PM, grigri <[email protected]> wrote:
> 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 <[email protected]> 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 [email protected]
> To unsubscribe from this group, send email to
> [email protected]<cake-php%[email protected]>For
> 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 [email protected]
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
