1

I recently noticed this weird bug in CI(3.1.3 but might as well be present in other versions). The navtive validation rules like required, valid_email etc don't run while I use the callback. I've already built a My_Form_validation library to make the callback validation rules work with HMVC. But that seems to create another bug in the form_validation library. For eg. I've the following validation rules setup:

    $this->form_validation->set_rules('email', "Email",'required|valid_email|callback__validate_credentials|callback__check_user_status');

The validation rules should be run in the order they are stated, but the validation rules goes straight to validating the callbacks without checking the "required" and "valid_email" rules. These native validation rules run as they should if I remove the callbacks. Has anybody found a fix around this? Thanx in advance.

razn
  • 69
  • 3
  • 10
  • https://www.youtube.com/watch?v=fTztVbjwjmE –  Jun 28 '17 at 01:36
  • I've already used the ur solution to make the callbacks work. My problem is the native validation rules not working (rather than the callbacks not working) while using together with callback. – razn Jun 28 '17 at 01:40
  • Yes. I too found this issue. so, i just splited the validation. eg: $this->form_validation->set_rules('email', "Email",'required|valid_email'); $this->form_validation->set_rules('email', "Email",'callback__validate_credentials'); $this->form_validation->set_rules('email', "Email",'callback__check_user_status'); – 438sunil Jun 28 '17 at 05:51
  • I tried it but doesn't work. The native validation still don't run after splitting up the rules. – razn Jun 28 '17 at 06:03

0 Answers0