![]() |
Trouble with set_value() & callback form validation - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Trouble with set_value() & callback form validation (/showthread.php?tid=36188) |
Trouble with set_value() & callback form validation - El Forum - 11-24-2010 [eluser]lennierb5[/eluser] I have the following set_rules for my form validation: Code: $this->form_validation->set_rules('code_1', 'Billing Code #1','trim|alpha_numeric|callback__validate_billing_codes'); The function it calls back to: Code: function _validate_billing_codes() { Now my problem is when I try to echo set_value('code_1'); It only works if there were no other validation errors before it on the form. But I can access the value using $_POST['code_1']; set_value 2-12 work just fine with no problems it is only code_1 that has trouble. Any suggestions as to why this is happening? I am temporarily using the $_POST['code_1'] solution. Trouble with set_value() & callback form validation - El Forum - 11-25-2010 [eluser]InsiteFX[/eluser] PHP arrays are 0 based - Try $i = 0; InsiteFX Trouble with set_value() & callback form validation - El Forum - 11-26-2010 [eluser]lennierb5[/eluser] That produced an error since code_0 does not exist. I actually worked around this by putting my callback function in a hidden field that didn't need to be validated. No problems with set_value then. I am using CI 2.0 not sure if this could be a bug or if is an odd error somewhere else in my code. |