Hi All,
How can I display data from database of the selected drop-down item in a form?
I’m trying to display the data in some text-fields that is shown only when an item is selected from the drop-down.
I have the following code in the form:
<?php echo $form->dropDownList($model,'business_id',
Business::model()->getBusinessName() + array('addNew'=>'Add New...'),
array('onchange'=>"{javascript:
if(this.value =='addNew') {
addBusiness();
$('#dialogBusiness').dialog('open');
return false;
}
else {
// a function to get data from the database with the selected value from the drop-down list
getBusinessPartnerDetails(this.value);
}
}"),
array('empty'=>'#')); ?>