hola foro alguien sabe como definir el name y id del dropdownlist?
hola foro alguien sabe como definir el name y id del dropdownlist?
Buenos días.
En primer lugar:
Dropdownlist
En segundo lugar:
echo CHtml::dropDownList(
'nombreDropdowList',
'valorSeleccionado',
array('datosAMostrar'),
array('id'=>'idDropDownList')
);
Un saludo
hola buenos dias… mira esto?
<?php echo $form->labelEx($tipo,'tipo'); ?>
<?php $options = array('Interno'=>'Interno','Externo'=>'Externo'); ?>
<?php echo $form->dropDownList($tipo,'tipo', $options,array('empty' => 'Seleccione ...'),
array('name'=>'tipo', 'onChange'=>'pagoOnChange(this)', 'id'=>'tipo')); ?>
<?php echo $form->error($model,'tipo'); ?>
yo vi por alli q las opciones del html se metian en un array de esta manera en el dropdownlist.. peroo no me funciona, no me hace el cambio q hace de esta manera q es lo q necesito:
</div>
<SELECT NAME="tipo" onChange="pagoOnChange(this)" id="tipo">
<option value='0'> seleccione</option>
<OPTION VALUE="Interno">Interno</OPTION>
<OPTION VALUE="Externo">Externo</OPTION>
</SELECT>
</div>
Buenas.
Para el dropdownlist de un form este código te debería funcionar:
echo $form->dropDownList($model,
'nombreCampo',
array('datos'),
array(
'name' => 'nombreDropDownList',
'id' => 'isDropDownList',
)
);
Esto q tú pones está mal:
echo $form->dropDownList(
$tipo,
'tipo',
$options,
array('empty' => 'Seleccione ...'),
array('name'=>'tipo', 'onChange'=>'pagoOnChange(this)', 'id'=>'tipo')
);
Debería de ser:
echo $form->dropDownList(
$tipo,
'tipo',
$options,
array('name'=>'tipo', 'onChange'=>'pagoOnChange(this)', 'id'=>'tipo')
);
Si $options son los datos que quieres mostrar en el DropDownList.
Para q lo entiendas:
DropDownList de Form
Como comprobarás, sólo tiene 4 parámetros, no 5!!!!
Un saludo.
si ya lo hice gracias… es q soy demasiado nueva en programacion… estoy es aprendiendo todo practicamente de cero! por ejemplo ahora estoy haciendo el for q me guarde lo q lista! y no tengo ni idea de como hacerlo!
No entiendo lo que quieres hacer.
Q significa eso del "for" que te guarde los datos??
Que quieres hacer?
Un saludo.