[eluser]Unknown[/eluser]
I have a controller that performs the form_validation check:
Code:
function sample_form() {
if ($this->form_validation->run() == TRUE) {
$this->load->view('success_view');
}
}
And the
"success_view" view that represents the data:
for example:
Code:
<?php
echo set_value('name');
echo set_value('surname');
echo set_value('note');
?>
There is also a
$config array in
form_validation.php that sets the default validation rules for a controller:
Code:
$config = array(
'sample_ctrl/sample_form' =>
array(
array('field' => 'name', 'label' => 'Name', 'rules' => 'required'),
array('field' => 'surname', 'label' => 'Surname', 'rules' => 'required')
)
);
The validation works as it should on
"name" and
"surname", but the
"note" seems to be the problem. It has no set validation rule and it allows anything to be input, but the problem is that the
set_value('note') does not refill the textbox when I submit the form (the code was not written for brevity).
Even more strange thing is that when I add an empty rule to the
$config array, everything works fine and
set_value refills the input textbox as intended:
Code:
array('field' => 'note', 'label' => 'Note', 'rules' => '')
Am I missing some important concept with validation, or is this some kind of a bug?