In my dropdownlist, when I choose Percentage
, the label of the 'vendorcommision'
(next field) should be "Percentage"
. When I choose Amount
, the label should be "Amount"
if($model->userType!="ADMIN" && $model->userType!="HOST"){
echo $form->field($model, 'fixedOrPercentagevendor')
->dropDownList(
[0=>'Amount',1=>'Percentage'],
[
'onchange'=>'if($(this).val() == 1){
$("#percentage").val("20");
}
else{
$("#percentage").val("1000");}'
]);
echo $form->field($model, 'vendorcommision')
->label('Vendor Fee')
->textInput(['type' => 'number','id' => 'percentage']);
}