[eluser]runrun[/eluser]
Wait, I believe I've just found a bug.
The error message won't show if you validate radio button singlely. The form validation class only if your form has more than rule set. Compare the code below and the original code.
Code:
<?=validation_errors()?>
<form id=“sell_form” method=“post”>
<div class=“left_col float_l”>
<input type=“radio” value=“1” name=“sell_option” id=“classification” />
<label for=“classification”>classification</label>
</div>
<div class=“right_col float_l”>
<input type=“radio” value=“2” name=“sell_option” id=“auction” />
<label for=“auction”>auction</label>
</div>
<input type="text" name="id" />
<div class=“clear_float center”><input type=“submit” value=“GO” /></div>
</form>
Quote:class Sell extends Controller
{
function index()
{
$this->load->library('form_validation');
$this->form_validation->set_rules('sell_option', 'Sell option', 'required');
$this->form_validation->set_rules('id', 'ID', 'required' );
if ($this->form_validation->run() == FALSE)
{
$this->load->view('sell_view');
}
else
{
redirect('sell/sell_step1');
}
}
}
In the view I added an input field with name 'id'. In the controller i added rule set for the new added input. Now the error messages will shows up if the form is not valid.