Guest User

Untitled

a guest
Apr 16th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. $this->form_validation->set_rules('username', 'Username', 'required|_max_length[12]');
  2.  
  3. function _max_length($val)
  4. {
  5. if (strlen($this->input->post('username')) > $val)
  6. {
  7. $this->form_validation->set_message('_max_length', 'Max characters allowed: 5')
  8. return FALSE;
  9. }
  10.  
  11. return TRUE;
  12. }
  13.  
  14. $this->form_validation->set_message('username_check', 'The %s field can not be the word "test"');
  15.  
  16. $this->form_validation->set_message('max_length', 'The field %s max length is %s');
  17.  
  18. $this->form_validation->set_message('validation_rule', 'Your message here');
  19.  
  20. $this->form_validation->set_message('max_length', 'Max characters allowed: 5');
Add Comment
Please, Sign In to add comment