This is the model file vechile_enquiry.php
<?php
class VechileEnquiry extends AppModel{
var $name ='VechileEnquiry';
var $validate = array('name' => array
('rule' => 'notEmpty',
'message' => 'Please type name')
);
}
?>
This is the view file vechile.ctp
<?php
echo $this->Form->input('name', array('label'=>false));
?>
At least one phone number is required:
<?php
echo $this->Form->input('mobile_phone', array('label'=>false));
echo $this->Form->input('work_phone', array('label'=>false));
echo $this->Form->input('home_phone', array('label'=>false));
?>
Validation is working in the name field but I’m not getting how to implement validation in mobile_phone,
work_phone, home_phone for the condition that at least one phone number is required.
This should do it for you: