1

i have problem to give value in radio button (Approve and Disapprove). the case is if "Status" = A, so radio button checked to Approve, else if "Status" D, so radio button checked to radio button Disapprove :

<tr>
    <td style="width:200px;">Status Product </td>
    <td>
        <?=
                $form->field($model, 'ProductID')
                ->radioList(['A' => 'Approved', 'Approved' =>        'DisApproved'], ['style' => 'display:inline', 'labelSpan' => '0px', 'name' => 'of-status'])->label(false)
        ?>

    </td>
</tr>

and i have split pop up

$('input[name=of-status]',opener.document).val(row.find("td:nth-child(8)").text()); 

this no problem about split popup

  • Try this one `= $form->field($model, 'ProductID')->radioList(['A' => 'Approved', 'D' => 'DisApproved'], ['style' => 'display:inline', 'labelSpan' => '0px', 'name' => 'of-status'])->label(false) ?>` – vishuB Aug 02 '16 at 06:26

2 Answers2

0

Try this:

<?=Html::activeRadioList($model, 'ad_art',
        [1 => 'Approved', 2 => 'DisApproved'], [
        'item' => function ($index, $label, $name, $checked, $value) {
             $checked ? ' checked="checked"' : '';
            return '<label class="radio-inline">' . Html::radio($name, $checked, ['value'  => $value]) . $label . '</label>';
        }
    ])?>
Muhammad Shahzad
  • 9,340
  • 21
  • 86
  • 130
-1

Please check this link. it may help you

https://stackoverflow.com/a/28631700/5714577

Or try using this .

<?=$form->field($model, 'gender')
    ->radioList(
        [1 => 'Male', 0 => 'Female'],
    )
->label(false); ?>
Community
  • 1
  • 1
Sunil kumar
  • 761
  • 5
  • 15