I add this Yii
input to my form:
echo $form->dropDownList($model,'contact_type_id',$model->getContactParams(), array('class'=>'form-control'));
Is it possible to add this input dynamically with jQuery?
I add this Yii
input to my form:
echo $form->dropDownList($model,'contact_type_id',$model->getContactParams(), array('class'=>'form-control'));
Is it possible to add this input dynamically with jQuery?
use ajax for this.
$('#addContact').click(function() {
$.ajax({
url: "your url here",
type: "POST",
dataType: "HTML",
async: false,
data: {"name":value},//if you want to send any data.
success: function(data) {
// here append the select to required div.
}
});
});
In the url, you fetch the data from database and print there.