moj ajax:
Kod
function ajaxl(list_id,kat_id){
if (document.getElementById(list_id).length < 2){
advAJAX.get({
url: "http://plik.php?list_id="+list_id+"&kat_id="+kat_id,
onSuccess : function(obj) {wypelnij(obj.responseText,list_id);},
onError : function(obj) { alert("Error: " + obj.status); }
});
}
}
function wypelnij(tresc,list_id){
pr_name_value=tresc.split("^^");
var lst = document.getElementById(list_id);
var i=0;
for(i=0;i<pr_name_value.length-1;i++){
var opt = document.createElement("option")
opt.value=pr_name_value[i]
pr_name=pr_name_value[i].split("||");
opt.appendChild(document.createTextNode(pr_name[1]));
lst.appendChild(opt);
}
}
if (document.getElementById(list_id).length < 2){
advAJAX.get({
url: "http://plik.php?list_id="+list_id+"&kat_id="+kat_id,
onSuccess : function(obj) {wypelnij(obj.responseText,list_id);},
onError : function(obj) { alert("Error: " + obj.status); }
});
}
}
function wypelnij(tresc,list_id){
pr_name_value=tresc.split("^^");
var lst = document.getElementById(list_id);
var i=0;
for(i=0;i<pr_name_value.length-1;i++){
var opt = document.createElement("option")
opt.value=pr_name_value[i]
pr_name=pr_name_value[i].split("||");
opt.appendChild(document.createTextNode(pr_name[1]));
lst.appendChild(opt);
}
}
mam jeszcze taki problem ze po zapełnieniu selecta w ie (funkcję wywołuje onClick przy sekcie) lista zwija sie po wypełnieniu, w ff i opera rozwija sie noramlnie i ładuje zawartośc i mozna coś wybrać