I got this in my view.
<input type="radio" name="male" value="0">Male</input>
<input type="radio" name="female" value="1">Female</input>
What do I have to do to get any of these values? I need it to send them later to the database, so I have to get 0 or 1 to fill that field.
Since the name of your input are separate, it won't really function as radio buttons. Try changing the name to something like "gender" and add appropriate values to it. It can be 0 for male, 1 for female, or just the term male and female. I used the latter for the example below. The controller section uses a form_validation library, which should be very useful when dealing with forms.
View:
<input type="radio" name="gender" value="male">Male</input>
<input type="radio" name="gender" value="female">Female</input>
Controller:
$this->load->library('form_validation');
$this->form_validation->set_rules('gender', 'Gender', 'required'); // This will check if gender is selected.
if ($this->form_validation->run()) {
$gender = $this->input->post('gender'); // This will contain "male" or "female"
}
else {
$error = validation_errors();
}
Make the names of both radio buttons the same. Example gender
. In your controller do $this->input->post('gender');
to get the value
<div class="mtm _5wa2 _5dbb" id="u_0_f">
<span class="_5k_3" data-type="radio" data-name="gender_wrapper" id="u_0_g">
<span class="_5k_2 _5dba">
<input type="radio" name="sex" value="1" id="u_0_d">
<label class="_58mt" for="u_0_d">Female</label>
</span>
<span class="_5k_2 _5dba">
<input type="radio" name="sex" value="2" id="u_0_e">
<label class="_58mt" for="u_0_e">Male</label>
</span>
</span>
<i class="_5dbc _5k_6 img sp_FbRIIaK1AuN sx_ebf223"></i>
<i class="_5dbd _5k_7 img sp_FbRIIaK1AuN sx_1e1628"></i>
</div>
You need to edit custom.css
layout.css
and a few others just go to your site reg page and press ctrl shift I and look at the locations of code