Good day, I am forced to request your help, I consult you I have a form that I have the following
<?= $form->field($model, 'cd_categoria',['labelOptions'=>['style'=>'color:black']])->dropdownList($model->getListaCategoria(), ['prompt' => '---Seleccione Categoria---',
['maxlength'=>50,'style'=>'width:500px; color:black; ',
'onChange'=>'
$.post("list?id='.'"+$(this).val(), function(data) {
if(data=="1"){
$( "#result" ).show();
}else{
$( "#result" ).hide();
}
});']]) ?>
<div id="result" style="display:none;">
<?= $form->field($model, 'nu_personas',['labelOptions'=>['style'=>'color:black']])->textInput([['maxlength'=>50,'style'=>'width:500px; color:black; ']]) ?>
</div>
public actionList($id){
if($id==19){
echo "1";
}else{
echo "0";
}
}
What I need to do is that when I select the div, a specific option shows me the div below that of the '' nu_personas '' and if I do not continue showing it, someone can tell me what may be happening