/    Sign up×
Community /Pin to ProfileBookmark

DHTML issues with IE

I am trying to produce a table dynamically when the user presses “add to queue”. It works great in Mozilla, but it is formatted incorrectly in IE. Here’s a link:

[URL=http://helios.acomp.usf.edu/~torr2/test/test.php]http://helios.acomp.usf.edu/~torr2/test/test.php[/URL]

Specifically, the checkbox is not checked and the css classes don’t seem to be working. This only happens in IE and I can’t figure it out.

Thanks For any help you can give,
Tom

to post a comment
JavaScript

9 Comments(s)

Copy linkTweet thisAlerts:
@FangSep 10.2003 — I don't think that setting the class is supported in IE.

[URL=http://forums.webdeveloper.com/showthread.php?s=&threadid=15452&highlight=class]Here[/URL] is a similar problem with a work around.

The checkbox appears to be working in IE6.
Copy linkTweet thisAlerts:
@redijediauthorSep 11.2003 — It seems that the work around will add style to an element selector. Unfortunately I need the class to be applied to only specific elements in the table. I need the row in the queue to be formatted, not every row. Also, what I meant by the checkbox was that it should be checked by default. IE doesn't do this while mozilla does.

Thanks, though
Copy linkTweet thisAlerts:
@FangSep 11.2003 — Looks like browser detection is necessary for class :mad: see [URL=http://lists.w3.org/Archives/Public/www-dom/2000OctDec/0175.html]this[/URL]

As for the [COLOR=green]chk.setAttribute("checked", true);[/COLOR] have you tried "true" string?

Or chk.checked = true;
Copy linkTweet thisAlerts:
@redijediauthorSep 11.2003 — Yeah, I tried the string "true", I tried "on", I tried "checked". Doesn't seem to work.?

IE seems to not like to set attributes in general. Its funny because I usually find myself having to work around mozilla, but when it really counts I lose the most heavily installed browser base.:mad:

Thanks
Copy linkTweet thisAlerts:
@FangSep 11.2003 — [COLOR=green]chk.checked = true;[/COLOR] should work.

Any luck with the class?

You may want to try this after an appendChild

[COLOR=green]if(document.all){obj.innerHTML = obj.innerHTML;} [/COLOR]

It's a fix from [B]Khalid[/B] for IE, some sort of update of the DOM tree.

IE won't be updating it's browser for possibly another 2 years,

and then it will probably be XHTML2 compliant. Meanwhile Moz. and others are constantly improving, but still loosing their users. It's not always "the best wins".
Copy linkTweet thisAlerts:
@redijediauthorSep 11.2003 — The checkbox still doesn't work. How would I use that work around? I tried it in several places, but it threw out an error. I assumed that I was supposed to change tdiv to whichever element I had just appended to.
Copy linkTweet thisAlerts:
@FangSep 11.2003 — This simple version works:
[code=php]var oInput = document.createElement('input');
oInput.setAttribute('type', 'checkbox');
beforeObj=document.getElementById("submit");
document.getElementById("myform").insertBefore(oInput, beforeObj);
oInput.checked="true";
[/code]
Copy linkTweet thisAlerts:
@redijediauthorSep 11.2003 — The only difference, algorithmically, I see is that the checkbox is checked after being inserted into the document. I tried this, and it works! ? Isn't that odd? The only caveat is that I had to remove my attempts at the work around you showed me concerning refreshing the dom. So now I've just got to figure out how to get the class working.

Thanks for your all your help!
Copy linkTweet thisAlerts:
@FangSep 11.2003 — Odd, that's IE for you.

Was the [URL=http://lists.w3.org/Archives/Public/www-dom/2000OctDec/0175.html]class link[/URL] of any use?
×

Success!

Help @redijedi spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...