Jump to content


set_rules regex_match not working

set_rules regex

  • Please log in to reply
1 reply to this topic

#1 Faisal Naseer

Faisal Naseer

    Newbie

  • Members
  • Pip
  • 5 posts

Posted 26 July 2016 - 03:08 PM

I am trying to create regex validation on a field  named start_time in particular table

$crud->set_rules('start_time','Start Time','regex_match[/^(?:07:30|(0[8-9]|1[0-6]):[03]0)$/]');

reg ex is completed tested on regex101.com

but as I add or edit field I come across with error Unable to access an error message corresponding to your field name Start Time.(regex_match[/^(?:07:30)

 

 

 



#2 Amit Shah

Amit Shah

    grocery CRUD Master

  • Advanced Member
  • PipPipPip
  • 1,192 posts
  • LocationMumbai, India

Posted 28 July 2016 - 11:10 AM

Hi there,

 

If u refer to the set rules documentation - this is the same as the codeigniter rules.

https://codeigniter....alidation-rules

 

What you should be doing here to have a workaround is callback method where u do the processing of the data validation.

look for the line below in the url above - it will give u the example for what i am saying

$this->form_validation->set_rules('username', 'Username', 'callback_username_check')

 

Happy GCing :)







Also tagged with one or more of these keywords: set_rules, regex

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users