[eluser]nl_vinyl[/eluser]
Hi,
I am trying to validate 2 radio buttons. They share the same name and have no default checked:
Code:
<label class="radio">
<input type="radio" name="verrekening" value="intijd" />
Label 1
</label>
<label class="radio">
<input type="radio" name="verrekening" value="uitbetalen" />
Label 2
</label>
And I am displaying the errors in my form like this:
Code:
<?php if(validation_errors()): ?>
<div class="alert alert-error">
<?php echo validation_errors(); ?>
</div>
<?php endif; ?>
My controller has the rules set up like this:
Code:
$this->form_validation->set_rules('verrekening', 'Verrekening', 'required');
$this->form_validation->set_error_delimiters('<div class="error">', '</div>');
$this->form_validation->set_message('required', '<strong>%s</strong> niet opgegeven.');
If i do not select a checkbox, I am returned to the form but not error is shown. If I select an option the form is processed. I cant find what I am doing wrong.
If I chance the radiobuttons in a simple text field and leave that empty the error is shown. Does the validation helper have an issue with radio buttons?