Vicky
Vicky

Reputation: 9585

How to get group radio button Value using Code ingnitor in the controller

I have two radio button

<input tabindex="3" type="radio" name="gender" id="gender" value="M">Male&nbsp;<input tabindex="4" type="radio" name="gender" id="gender" value="F">Female

How to get group radio button Value using Code ingnitor

$this->input->post("gender");

I want to retrieve selected radio button value as "M" or "F" In the controller side.

Upvotes: 0

Views: 1136

Answers (1)

sshet
sshet

Reputation: 1160

<input tabindex="3" type="radio" name="gender[]" id="gender" value="M">Male
<input tabindex="4" type="radio" name="gender[]" id="gender" value="F">Female

$this->input->post('gender')

Thanks Sanil

Upvotes: 1

Related Questions