Advertisement
Phantom1605

Error Form Validation

Mar 2nd, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.50 KB | None | 0 0
  1. /* Controller */
  2.  
  3.     public function checkKategori($param){
  4.         if ($param == '#') {
  5.             $this->form_validation->set_message('checkKategori', 'Nama Kategori belum dipilih.');
  6.             return FALSE;
  7.         }else{
  8.             return TRUE;
  9.         }
  10.  
  11.         return TRUE;
  12.     }
  13.  
  14. /* Model */
  15.  
  16. public function getValidationRules(){
  17.         $validationRules = [
  18.             [
  19.                 'field' => 'Cmb_KategoriBarang',
  20.                 'label' => 'Kategori belum dipilih',
  21.                 'rules' => 'trim|required|callback_checkKategori'
  22.             ]
  23.         ];
  24.         return $validationRules;
  25.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement