cks
cks

Reputation: 153

can i use multiple radio button in the form like this

enter image description herehello

i am not being able to submit these value in my controller. the code is as follows

<input name="status.<?php echo $data['LEAVE_ID']?>" type="radio" class="ace" value="1" checked="" required="" />
  <span class="lbl">&nbsp;YES</span>&nbsp;
<input name="status.<?php echo $data['LEAVE_ID']?>" type="radio"   class="ace" value="0"/>&nbsp;
   <span class="lbl">&nbsp;NO</span>

Upvotes: 0

Views: 239

Answers (2)

LuFFy
LuFFy

Reputation: 9297

You can achieve it using below code, you just have to add css.

<?php
foreach($dataArrry as $data) {
    echo $_POST['status.' . $data['LEAVE_ID']]."<br/><br/>";
}
?>

Upvotes: 0

JYoThI
JYoThI

Reputation: 12085

For multiple radio use array in name attribute with id as a index key like this

name="status[<?php echo $data['LEAVE_ID']?>]"

Upvotes: 1

Related Questions