[eluser]Vince Stross[/eluser]
Correction: After playing with this, I have to report that the set_select() function is working properly for me. The issue (now resolved but not comfortable with) is that the form fields have to be defined whether they have rules or not. I was assuming that the set_value(), set_select(), etc. functions were doing this for me.
In other words:
Code:
$config=array(
array('field'=>'display','label'=>'Display','rules'=>'trim|required|max_length[50]'),
array('field'=>'content','label'=>'Content','rules'=>''),
);
$this->form_validation->set_rules($config);
I would much rather have this be something like:
Code:
$config=array(
array('field'=>'display','label'=>'Display','rules'=>'trim|required|max_length[50]'),
array('field'=>'content','label'=>'Content'),
- or (at the VERY least) -
array('field'=>'content','label'=>'Content','rules'=>false),
);
$this->form_validation->set_rules($config);
Something doesn't feel right about having to define the rule as '' when it would be cleaner to just omit it all-together and check in the CI code using isset().