javascript - Jquery to disable previous radio buttons in Yii2 -
<?= $form->field($model, 'status')->radiolist(array('1'=>'approved','2'=>'digital','3'=>'cdp','4'=>'print','5'=>'other process','6'=>'packing','7'=>'dispatch',)); ?> i'm trying implement status update form. want know how can disable previous radio buttons.
e.g- if current status cdp status "approved" , "digital" should disable.
how write java script this, im implementing in yii2 framework.
try listen if choose radio button. '.disable' on every button '.each' until reached key.
edit: hate write blind try this:
$('#radiobuttons').on('change', function(){ var val = this.value; $.each(arrayname, function( index, value ){ if(index < val){ value.disable(); }else{ value.enable(); } }); }); if selected value smaller, disable, otherwise anabled. if way can´t change choice button above ? want ?
Comments
Post a Comment