Form Validation Issue - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6) +--- Forum: Issues (https://forum.codeigniter.com/forumdisplay.php?fid=19) +--- Thread: Form Validation Issue (/showthread.php?tid=66286) |
Form Validation Issue - krishg - 10-03-2016 Migrating from CI 2.x to 3.0. This form validation issue is tripping me. Here is what I have i Code: if(!isset($_POST['event_create'])){ Unable to access an error message corresponding to your field name Event Start Time.(regex_match[/^(?=\d)(??!(?:1582(?:\.) Unable to access an error message corresponding to your field name Event End Time.(regex_match[/^(?=\d)(??!(?:1582(?:\.) Worked fine with CI 2.1. xss filter flag is set to true. I have checked that we are not using xss_clean in form_validation->set_rules. Code: $config['global_xss_filtering'] = TRUE; I added $autoload['helper'] = array('security') so, my autoload.php for helpers looks like this Code: $autoload['helper'] = array('form', 'url', 'utility' ); This change prevented the error message from displaying on form validation, but resulted in new errors Severity: Error Message: Call to undefined function url_title() Filename: controllers/Events.php Line Number: 756 Fatal error: Call to undefined function base_url() in /var/www/html/application/views/errors/html/error_php.php on line 10 edit: Looking at the logs I found this Code: INFO - 2016-10-03 17:31:40 --> Language file loaded: language/english/form_validation_lang.php I went ahead and added this to system\language\english\form_validation_lang.php $lang['form_validation_regex_match'] = 'The {field} must be a valid time'; No change. Curious thing is that the error message in the log is not displaying the complete regex pattern Any ideas? RE: Form Validation Issue - InsiteFX - 10-03-2016 Are you missing the ending / slash on both of your regex_match? RE: Form Validation Issue - krishg - 10-03-2016 (10-03-2016, 06:14 PM)InsiteFX Wrote: Are you missing the ending / slash on both of your regex_match? Don't think so. It's there after the $ sign. It worked just fine in CI 2.0. RE: Form Validation Issue - krishg - 10-03-2016 FWIW, I used a callback function for the form validation. That does not get called as well. I get this in the log file DEBUG - 2016-10-03 21:05:35 --> Unable to find callback validation rule: datetime_check ERROR - 2016-10-03 21:05:35 --> Could not find the language line "form_validation_datetime_check" RE: Form Validation Issue - krishg - 10-03-2016 (10-03-2016, 09:24 PM)krishg Wrote: FWIW, I used a callback function for the form validation. That does not get called as well. I get this in the log file Looks like we have a custom validation form. I put the callback function there and it's getting called there. RE: Form Validation Issue - InsiteFX - 10-04-2016 All Controller, Libraries and Model files have to have the first character upper case. |