remico
Member
Hi all,
Probably a stupid question and I read all the wiki and forums but I can?t get my dropdown list filled based on AJAX. I can't use CCD in this case because I have to do some stuff on the data needed for the dropdown.
I can fill a simple textfield based on AJAX based on user_ajax.php and a JS function called on change, but I can?t populate a dropdown...
I?m now using this sample from wiki:
My php script is returning this string (JSON) as a sample: [{"value":"","text":"","disable":false},{"value":"1","text":"A4"},{"value":"3","text":"A3"},{"value":"7","text":"SRA3"}]
There are no JS errors in the console and I'm receiving the string from my script, but it is not populating my dropdown... I'm noticing that dropdown-min.js is not called (I think this is containing the update function) and that is probably the problem, but I don't know how to do this.
Any tips on what I'm missing? My question is actually how to populate a dropdown with AJAX...
Probably a stupid question and I read all the wiki and forums but I can?t get my dropdown list filled based on AJAX. I can't use CCD in this case because I have to do some stuff on the data needed for the dropdown.
I can fill a simple textfield based on AJAX based on user_ajax.php and a JS function called on change, but I can?t populate a dropdown...
I?m now using this sample from wiki:
Code:
function ajaxTest() {
var url = "index.php?option=com_fabrik&format=raw&task=plugin.userAjax&method=etStateDropDown";
new Request({url:url,
method: 'get',
update: document.id('jos_fabrik_formdata_13___states')
}).send();
}
My php script is returning this string (JSON) as a sample: [{"value":"","text":"","disable":false},{"value":"1","text":"A4"},{"value":"3","text":"A3"},{"value":"7","text":"SRA3"}]
There are no JS errors in the console and I'm receiving the string from my script, but it is not populating my dropdown... I'm noticing that dropdown-min.js is not called (I think this is containing the update function) and that is probably the problem, but I don't know how to do this.
Any tips on what I'm missing? My question is actually how to populate a dropdown with AJAX...