Hello,
I have select(/dropdown) list.Below is code
<div id="complete_form">
<b>Skill Type :</b>
<select id="skill_type_name" onchange="load_div()">
<option value="">Select</option>
<option value="Language">Language</option>
<option value="Database">Database</option>
<option value="Framework">Framework</option>
</select>
<div id="id_skill_name" onchange="load_other_skill()">
<b>Skill : </b>
<select id="skill_name" name="Skill[skill_id]">
<option value="">Select</option>
<option value="test language 1">test language 1</option>
<option value="test db 2">test language 2</option>
<option value="test fw 3">test langugae 3</option>
</select>
</div>
In this I want to functioning like:
clicking on first div should load values in 2nd div.
2nd div's values are fetched from DB.
var $j = jQuery.noConflict();
$j.ajax({
url:'index.php?r=Skill_form/ReflectSkillNames',
type:'POST',
data:name={'first_skill_type':first_skill_type,},
success:function(skill_data2){
skill_data=skill_data2;
alert(skill_data);
});
and in ReflectSkillNames method I have fetch values from DB.
when I var_dump the array in ReflectSkillNames and alert it in ajax call.
then it shows me var_dump.
but now how to set those array values to <select>
???