I have the following code in a module
Code: Select all
$lists['pcat_id'] = JHTML::_('select.genericlist',$p_category, 'pcat_id', 'class="inputtext" onchange="getsubcat(this.value);" ', 'pcid', 'title',0);
Code: Select all
function getsubcat(cid)
{
xmlHttp = GetXmlHttpObject();
var subcat_label=document.getElementById("sc_label").value; // Imported Label for List from helper.php
xmlHttp.onreadystatechange =function() {
if (xmlHttp.readyState == 4 && xmlhttp.status==200) {
document.getElementById("sub_div").innerHTML=xmlHttp.responseText; // Element id in default layout
}
}
var url = live_path+"modules/mod_cyril_ajaxselectcontent/subcategories.php?pcat_id="+cid+"&subcat_lbl="+subcat_label;
xmlHttp.open("GET", url, true)
xmlHttp.send(null);
}
The following works as I have placed this url in my browser and substituted with exact values and I know the php for subcategories.php works.
Code: Select all
var url = live_path+"modules/mod_cyril_ajaxselectcontent/subcategories.php?pcat_id="+cid+"&subcat_lbl="+subcat_label;
Cheers