Welcome Guest, Not a member yet? Register   Sign In
Form Validation class/repopulating
#1

[eluser]mcair[/eluser]
Noob to CI, need help understand the Form Validation class, specifically when re-populating the form

Controller has logic:
Code:
$this->form_validation->set_rules('shortdesc','League Name','required|trim|min_length[1]|max_length[45]');
    $this->form_validation->set_rules('longdesc','Comments','trim|max_length[255]');

and this appears to work. Having done this, and following the example from the user guide I expect that

Code:
echo 'set_value::shortdesc='.set_value('shortdesc');

will display the submitted value in the shortdesc input field. It doesn't. When I echo the $_POST['shortdesc'] I can see the submitted value. I get the impression from the user guide that set_rules will create and store a member variable on the Form Validation class that corresponds to the input field.

I added the following immediately after the set_rules, it made no difference:

Code:
$fields['shortdesc'] = 'League Name';
    $this->validation->set_fields($fields);


Any guidance you can offer is much appreciated.


Messages In This Thread
Form Validation class/repopulating - by El Forum - 11-01-2009, 09:10 PM
Form Validation class/repopulating - by El Forum - 11-01-2009, 09:14 PM
Form Validation class/repopulating - by El Forum - 11-01-2009, 09:25 PM
Form Validation class/repopulating - by El Forum - 11-01-2009, 09:27 PM



Theme © iAndrew 2016 - Forum software by © MyBB