Database populated form fields (e.g. edit mode) and form validation |
[eluser]huston[/eluser]
I am new to CodeIgniter and was frustrated by this same issue. I have been testing a different approach which seems to be working so far. First I extended the CI_Form_validation class to setup the _field_data when the request is not a POST. Then I added a method, set_default_value, to set the default values for the fields in _field_data. Code: class MY_Form_validation extends CI_Form_validation { Then I added a call to set_default_value to my controller to set the current value for a field. Code: $this->form_validation->set_default_value('email', '[email protected]'); Here is the example from the CI Form Validation documentation with this code added. form.php: Code: class Form extends Controller { And the code for the view remains unchanged from the CI documentation. myform.php: Code: <html> |
Messages In This Thread |
Database populated form fields (e.g. edit mode) and form validation - by El Forum - 12-16-2008, 10:00 PM
Database populated form fields (e.g. edit mode) and form validation - by El Forum - 12-16-2008, 10:12 PM
Database populated form fields (e.g. edit mode) and form validation - by El Forum - 12-16-2008, 11:55 PM
Database populated form fields (e.g. edit mode) and form validation - by El Forum - 12-17-2008, 01:23 AM
Database populated form fields (e.g. edit mode) and form validation - by El Forum - 12-17-2008, 04:52 PM
Database populated form fields (e.g. edit mode) and form validation - by El Forum - 02-24-2009, 11:33 AM
Database populated form fields (e.g. edit mode) and form validation - by El Forum - 02-24-2009, 01:31 PM
Database populated form fields (e.g. edit mode) and form validation - by El Forum - 02-24-2009, 04:54 PM
|