Autor Zpráva
maxAV
Profil
Proc se tohle IE nelibi? Ve FF to funguje (klasicky)

var tag=1;
var status=document.getElementById("chkbx"+tag).checked;
var newStatus= (status) ? false : true;
document.getElementById("chkbx"+tag).checked=newStatus;
peta
Profil *
maxAV
Co treba zbytek kodu?

Odhadem je chyba v tom, ze nepouzivas checked ale true/false...
Nekde to mam, ale posledne jsem pouzil toto, coz je podobne...

function objGet(x)
{var d=document;if(typeof x=='string')
x=d.getElementById?d.getElementById(x):d.all?d.all[x]:d.layers?d.layer s[x]:null;
return x;}

function objch(x,z) {objGet(x).checked=z}
function getchP(x) {return (objGet(x).checked)?1:0}

Dobre, takze fintu
var status=document.getElementById("chkbx"+tag).checked;
document.write(status);
OKI?
var status=document.getElementById("chkbx"+tag).checked;
var newStatus= (status) ? false : true;
document.write(newStatus);
OKI?

A ted je treba jeste davat pozor na to, ze window.status = "" neboli
status = ""
je zapis do statusbaru, s cimz se IE nemusi smirit
totez, kdyz v IE pouzijes play() , tak to IE pouziva pro prehravani hudby. Lepsi pouzit ceske nazvy.
maxAV
Profil
peta
dekuji za odpoved! je to pro me trosku krypticka zalezitost, ale zkusim se tim nejak prokousat :)
nevim, jestli by pomohl cely kod, ale situace je nasledujici - mam vedle sebe checkbox a odkaz, na obou je onclick, oba jak odkaz tak checkbox jsou vlastne prepinac... tady je kod te fce ktera jede ve FF, IE ji nespolkne a zahlasi:
"checked neni definovano"


function switchTag(tag,caller)
{
var link;
var cBoxStatus;
if (caller=="link"){
cBoxStatus=document.getElementById("chk"+tag).checked;
}
else {
cBoxStatus=!document.getElementById("chk"+tag).checked;
}

if (!cBoxStatus){
document.getElementById("chk"+tag).checked=true;
link = "add_tag.php?tag_id="+tag;
if (window.ActiveXObject)
{
httpRequest["addTag"] = new ActiveXObject("Microsoft.XMLHTTP");
}
else
{
httpRequest["addTag"] = new XMLHttpRequest();
}
httpRequest["addTag"].open("GET", link, true);
httpRequest["addTag"].onreadystatechange= function () {processArRequest("session-tags","addTag"); } ;
httpRequest["addTag"].send(null);
}
else {
document.getElementById("chk"+tag).checked=false;
link = "remove_tag.php?tag_id="+tag
if (window.ActiveXObject)
{
httpRequest["removeTag"] = new ActiveXObject("Microsoft.XMLHTTP");
}
else
{
httpRequest["removeTag"] = new XMLHttpRequest();
}
httpRequest["removeTag"].open("GET", link, true);
httpRequest["removeTag"].onreadystatechange= function () {processArRequest("session-tags","removeTag"); } ;
httpRequest["removeTag"].send(null);
}


}
Toto téma je uzamčeno. Odpověď nelze zaslat.

0