I am creating test project with codeigniter and i am struggling with radio buttons and options. I would like to create advance question form with for example 6 different radio buttons selects and input labels such name, surname etc (which i successfully achieved)
When i fill necessary fields and set test radio button to proper value and hit submit button simply nothing happen and. I can't find what causes the problem.
I am using here form helper (that says documentation to use set_radio)
I tried to use form_radio, set_radio etc. You will find my examples below
Here is my view (i didn't paste text input because that part is working)
<div class="row">
<?php
$attributes = array(
"name" => "registrationform",
"id" => "msform"
);
echo form_open("yourself/register", $attributes);
?>
<!-- progressbar -->
<ul id="progressbar">
<li class="active"><span class="circle">1</span> APPLY</li>
<li class="active"><span class="circle">2</span> FORM</li>
<li><span class="circle">3</span> CHECK</li>
</ul>
<!-- FORM Yourself -->
<fieldset>
<div class="input-box">
<h2 class="title">What licence would you like?</h2>
<input type="radio" name="what_licence" value="1" <?php echo set_radio('what_licence', '1', TRUE); ?> /> Black and white?</label>
<input type="radio" name="what_licence" value="2" <?php echo set_radio('what_licence', '2'); ?> /> Colour?</label>
</div>
<div class="form-group">
<button name="submit" type="submit" class="btn btn-default">Signup</button>
<button name="cancel" type="reset" class="btn btn-default">Cancel</button>
</div>
</fieldset>
<!-- FORM Yourself -->
</form>
<?php echo form_close(); ?>
<?php echo $this->session->flashdata('msg'); ?>
</div>
<!-- row -->
Here is my controller
$this->form_validation->set_rules('what_licence', 'What licence', 'required');
$this->form_validation->set_rules('initials', 'Initials', 'trim|required|alpha');
$this->form_validation->set_rules('lastname', 'Last Name', 'trim|required|alpha|min_length[3]|max_length[30]');
$this->form_validation->set_rules('email', 'Email ID', 'trim|required|valid_email|is_unique[yourself.email]');
$this->form_validation->set_rules('tel_number', 'Phone Number', 'required|numeric|min_length[9]|callback_uk_phone_check');
$this->form_validation->set_rules('address', 'Address', 'trim|required|alpha_numeric_spaces');
$this->form_validation->set_rules('post-code', 'Post Code', 'trim|required|alpha_numeric_spaces');
$data = array(
'what_licence' => $this->input->post('what_licence'),
'initials' => $this->input->post('initials'),
'lastname' => $this->input->post('lastname'),
'email' => $this->input->post('email'),
'tel_number' => $this->input->post('tel_number'),
'address' => $this->input->post('address'),
'post-code' => $this->input->post('post-code'),
);
'what_licence' is for radio button which does not work If you could advise me it would be great. I am getting bald that doesn't work Thanks in advance