How to set two call back function on same field |
When i set two different callback function on same field.only one callback function is called ,out of two
for example: $config = array( array('field' => 'userfile', 'label' => 'Userfile', 'rules' => 'callback_check_extension|callback_check_image', 'errors' => array('check_extension'=>'Please upload Jpg/jpeg/gif/png image','check_image' => 'Invalid image.')), ); function check_image() { $a=$_FILES['userfile']['size']; if($a > 9000) { return false; } else { return true; } } function check_extension() { $a=array("image/jpeg","image/jpg","image/png","image/gif"); $info=$_FILES['userfile']['type']; if(in_array($info,$a)) { return true; } else { return false; } } ---------------------- but when i run this program,that time only one callback function is calling ,out of two. |
Messages In This Thread |
How to set two call back function on same field - by pankajdurve - 05-05-2015, 10:25 PM
RE: How to set two call back function on same field - by mwhitney - 05-06-2015, 09:39 AM
|