Skip to content

Instantly share code, notes, and snippets.

@davialexandre
Created June 1, 2011 19:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davialexandre/1003157 to your computer and use it in GitHub Desktop.
Save davialexandre/1003157 to your computer and use it in GitHub Desktop.
Dependent dropdown sample
<div class="row">
<?php echo $form->labelEx($model,'ficha'); ?>
<?php echo $form->dropDownList($model,'ficha',
CHtml::listData($fichas, 'id', 'name'),
array(
'ajax' => array(
'type'=>'POST',
'url'=>CController::createUrl('movimentos/AtivosPorFicha'),
'update'=>'#Movimentos_id_servico',
),
'prompt'=>'Selecione a Ficha'
));
?>
<?php echo $form->error($model,'ficha'); ?>
</div>
<div class="row">
<?php echo $form->labelEx($model,'id_servico'); ?>
<?php echo $form->dropDownList($model, 'id_servico',
CHtml::listData($servicos, 'id', 'nome'),
array('prompt' => 'Selecione um Serviço Ativo'));
?>
<?php echo $form->error($model,'id_servico'); ?>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment