473,659 Members | 2,636 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.
What I meant by the checkbox was that it should be checked by default. IE
doesn't do this while mozilla does. Here's a link:

http://helios.acomp.usf.edu/~torr2/test/test.php

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
Jul 20 '05 #1
11 3520
you don't specify whether the checkbox should be checked or not by default.

Example,

document.Thomas Frm.objCheckbox .defaultChecked = true;

This will allow the item to be checked by default.

Orlando

Thomas wrote:
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.
What I meant by the checkbox was that it should be checked by default. IE
doesn't do this while mozilla does. Here's a link:

http://helios.acomp.usf.edu/~torr2/test/test.php

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


Jul 20 '05 #2
I appreciate you looking into the problem, however the checkbox is set to
the variable chk. I used:

chk.setAttribut e("checked", "true");

I've also used (in the past):

chk.setAttribut e("checked", true);
chk.setAttribut e("checked", "on");
chk.setAttribut e("checked", "checked");
chk.checked = true;
chk.checked = "true";

These do not work, although setting the name did work in this fashion. It
seems to me that IE picks and chooses which attributes it is going to allow
changes to at random. Note that Mozilla displays this page properly.

Thanks

"orlando echevarria" <or*****@engr.u conn.edu> wrote in message
news:3f******@n ews0.ucc.uconn. edu...
you don't specify whether the checkbox should be checked or not by default.
Example,

document.Thomas Frm.objCheckbox .defaultChecked = true;

This will allow the item to be checked by default.

Orlando

Thomas wrote:
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. What I meant by the checkbox was that it should be checked by default. IE doesn't do this while mozilla does. Here's a link:

http://helios.acomp.usf.edu/~torr2/test/test.php

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

Jul 20 '05 #3
DU
Thomas wrote:
I appreciate you looking into the problem, however the checkbox is set to
the variable chk. I used:

chk.setAttribut e("checked", "true");

I've also used (in the past):

chk.setAttribut e("checked", true);
chk.setAttribut e("checked", "on");
chk.setAttribut e("checked", "checked");
Do not use setAttribute to set such attribute.
chk.checked = true;
This is correct.
chk.checked = true;
should work in all DOM1 compliant browsers.

http://www.w3.org/TR/DOM-Level-2-HTM...ml#ID-30233917
chk.checked = "true";

These do not work
then it means something is wrong with your code.

, although setting the name did work in this fashion. It seems to me that IE picks and chooses which attributes it is going to allow
changes to at random. Note that Mozilla displays this page properly.

Thanks


DU
--
Javascript and Browser bugs:
http://www10.brinkster.com/doctorunclear/
- Resources, help and tips for Netscape 7.x users and Composer
- Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x
http://www10.brinkster.com/doctorunc...e7Section.html

Jul 20 '05 #4
DU
Thomas wrote:
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.
What I meant by the checkbox was that it should be checked by default. IE
doesn't do this while mozilla does. Here's a link:

http://helios.acomp.usf.edu/~torr2/test/test.php

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


I checked your code. *_Every_* single place where you use setAttribute,
there is a more efficient and better DOM 2 attribute to do your
instruction. It is widely known that setAttribute is not well supported
or working well on many browsers when corresponding DOM 2 attribute work
a lot better.
I would use insertRow and insertCell rather than createElement(" tr") and
createElement(" td") for several reasons I won't detail here.

Your code at times is very confusing. E.g.:

var row = document.create Element("tr");
var td = new Array();

Now, tell others viewing and reviewing your code (or even just yourself
in 3 months from now) that row is a reference to a row and td is a
reference to an array...

You're misusing innerHTML also IMO. innerHTML is best used to insert
html code, not to insert a text node or to modify the node value of a
text node.

Some other instructions will certainly create problems on browsers and
some PC with modest system resources. You use 4 levels of nested tables
and your page design only needs 1 table; 4 levels of nested tables for
such page is unjustified and will add to an already great burden (memory
management, DHTML performance, overall increased complexity). You resort
to 20 spacer filling gif images, deprecated attributes (e.g. font,
nowrap, etc.), document.write techniques along with DOM 2 methods. Some
of your instructions are correctly constructed but I wonder why you need
to create such a complex page. I.e. do you really need to create a 2
dimensions array variable to store hidden values? Have you considered
that such page could be too demanding for modest system resources? For
sure, some iterative instructions (having 13 DOM node references) will
be difficult to accomplish on some systems: some systems will just crash.

<td nowrap><font class="label">& nbsp;Year&nbsp; </font></td>
If this cell within a 4th level of nested table must not wrap, then
there is no need to use &nbsp;: it's redundant, unneeded.
Everywhere you use &nbsp; (more than 100) in 20 cells, you could just
replace and remove all these (tag soup) and all <font> tags with a
simple one-line-long css rule.

You use very recent modern attributes and methods with a very old,
deprecated, non-recommendable webpage design.

DU
--
Javascript and Browser bugs:
http://www10.brinkster.com/doctorunclear/
- Resources, help and tips for Netscape 7.x users and Composer
- Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x
http://www10.brinkster.com/doctorunc...e7Section.html

Jul 20 '05 #5
"Thomas" <re************ @netzero.net> wrote in message news:<et******* *************@c omcast.com>...
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.


Went to you web page, dropped into the debugger and traced it. Here is
what I found.

When you check the checkbox with the line:

chk.setAttribut e("checked", "true");

Everything is as it should be. Looking at chk.checked the value is
true. Then you execute the line:

td[1].appendChild (chk);

And chk.checked is false. I moved the first line down below the second
and then hit the problem at:

row.appendChild (td[i]);

Move it after the for loop and it hits again at:

myTBody.insertB efore(row,qsRow );

Finally, I moved the line as the last line in the function and it
works as it should.

Now EXPLAINING WHY it happens ... well, that is a whole other
ballgame. I have no idea why it does not work other than "bug"? Maybe
someone can shed some light.

Short-term fix is to move the line to the last one in the function and
add a comment indicating why it is there and not up in its proper
place.
Jul 20 '05 #6
Thank you very much, that does seem to fix the problem with the checkbox!
"Code Ronin" <co********@yah oo.com> wrote in message
news:67******** *************** ***@posting.goo gle.com...
"Thomas" <re************ @netzero.net> wrote in message news:<et******* *************@c omcast.com>...
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.


Went to you web page, dropped into the debugger and traced it. Here is
what I found.

When you check the checkbox with the line:

chk.setAttribut e("checked", "true");

Everything is as it should be. Looking at chk.checked the value is
true. Then you execute the line:

td[1].appendChild (chk);

And chk.checked is false. I moved the first line down below the second
and then hit the problem at:

row.appendChild (td[i]);

Move it after the for loop and it hits again at:

myTBody.insertB efore(row,qsRow );

Finally, I moved the line as the last line in the function and it
works as it should.

Now EXPLAINING WHY it happens ... well, that is a whole other
ballgame. I have no idea why it does not work other than "bug"? Maybe
someone can shed some light.

Short-term fix is to move the line to the last one in the function and
add a comment indicating why it is there and not up in its proper
place.

Jul 20 '05 #7
You certainly seem to know your stuff, so let me explain some of my choices
here.
I checked your code. *_Every_* single place where you use setAttribute,
there is a more efficient and better DOM 2 attribute to do your
instruction.
Probably, I was just following the examples one Apple's developer site. Had
I know of more widely accepted methods I would have used them.

Your code at times is very confusing. E.g.:
Now, tell others viewing and reviewing your code (or even just yourself
in 3 months from now) that row is a reference to a row and td is a
reference to an array...
You're right, I'm being inconsitent in my commenting. I don't usually
comment much, a fault I blame on my C background where comments are looked
down upon by my uber nerds peers.

You're misusing innerHTML also IMO. innerHTML is best used to insert
html code, not to insert a text node or to modify the node value of a
text node.
I tried to insert a text node, but I found it to be a quick and dirty fix to
use innerHTML. My bad.

Some other instructions will certainly create problems on browsers and
some PC with modest system resources. You use 4 levels of nested tables
and your page design only needs 1 table...
I know. I've tried to reduce this as much as possible, but this has been
the only way I've found to maintain the appearance accross browsers.

<td nowrap><font class="label">& nbsp;Year&nbsp; </font></td>
If this cell within a 4th level of nested table must not wrap, then
there is no need to use &nbsp;: it's redundant, unneeded.
Everywhere you use &nbsp; (more than 100) in 20 cells, you could just
replace and remove all these (tag soup) and all <font> tags with a
simple one-line-long css rule.
The non-breaking spaces are just for padding. I found that some browsers
ignore the padding style under certain circumstances, but never ignore the
&nbsp;

You use very recent modern attributes and methods with a very old,
deprecated, non-recommendable webpage design.


I know, but now you're just scolding me.

Thanks for the input
Jul 20 '05 #8
DU
Thomas wrote:
You certainly seem to know your stuff, so let me explain some of my choices
here.

I checked your code. *_Every_* single place where you use setAttribute,
there is a more efficient and better DOM 2 attribute to do your
instruction .

Probably, I was just following the examples one Apple's developer site. Had
I know of more widely accepted methods I would have used them.
Your code at times is very confusing. E.g.:
Now, tell others viewing and reviewing your code (or even just yourself
in 3 months from now) that row is a reference to a row and td is a
reference to an array...

You're right, I'm being inconsitent in my commenting. I don't usually
comment much, a fault I blame on my C background where comments are looked
down upon by my uber nerds peers.
You're misusing innerHTML also IMO. innerHTML is best used to insert
html code, not to insert a text node or to modify the node value of a
text node.

I tried to insert a text node, but I found it to be a quick and dirty fix to
use innerHTML. My bad.


CharacterDataNo de.nodeValue = "new text"
is flawlessly and impeccably supported by recent browsers. Updating text
node in such manner is also known to be 300% faster on slower systems.

Some other instructions will certainly create problems on browsers and
some PC with modest system resources. You use 4 levels of nested tables
and your page design only needs 1 table...

I know. I've tried to reduce this as much as possible, but this has been
the only way I've found to maintain the appearance accross browsers.


You only need 1 table because you're using tabular data; your data could
be linearized.

Open Source Web Design
http://www.oswd.org/

CSS Layout Techniques: Look Ma, No Tables at glish.com
http://glish.com/css/

CSS Tableless Sites
http://www.meryl.net/css/

You have to define what is your lowest common denominator for such
webpage design and purposes.
Right now, you're coding as if old browsers will be catered for while
using very recent DOM 2 attributes, methods which are known to be not
supporting such attributes and methods.
At the same time, recent browsers are served deprecated elements and
attributes as well. I don't see consistent in all this. FYI, using DOM 2
HTML methods is much more widely supported and reliable than
setAttribute().


<td nowrap><font class="label">& nbsp;Year&nbsp; </font></td>
If this cell within a 4th level of nested table must not wrap, then
there is no need to use &nbsp;: it's redundant, unneeded.
Everywhere you use &nbsp; (more than 100) in 20 cells, you could just
replace and remove all these (tag soup) and all <font> tags with a
simple one-line-long css rule.

The non-breaking spaces are just for padding. I found that some browsers
ignore the padding style under certain circumstances, but never ignore the
&nbsp;


That's certainly expectable if the html code commands no padding for cells:
<table border="0" cellpadding="0" cellspacing="0" >

Your HTML coding just unneedlessly increase size of the file while your
scripts are calling very recent DOM 2 methods.
You use very recent modern attributes and methods with a very old,
deprecated, non-recommendable webpage design.

I know, but now you're just scolding me.


Sorry if you feel this way; that was not my intent. I wanted to tell you
fair and square and in an explanatory manner that your design and coding
needs to be consequent and coherent.
Thanks for the input


DU
--
Javascript and Browser bugs:
http://www10.brinkster.com/doctorunclear/
- Resources, help and tips for Netscape 7.x users and Composer
- Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x
http://www10.brinkster.com/doctorunc...e7Section.html

Jul 20 '05 #9
I do appreciate it. I'm reworking it now. Scope creep has changed the
target browsers too often to count. At first we needed all 4.0 browsers and
up. Then we needed to use these recent methods that exclude older browsers.
I just kept adding to the code as opposed to rewriting it.

Thanks for your insights.
Tom
Jul 20 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
2694
by: Brett | last post by:
Both make use of DIV tags or layers. What are the main differences between DHTML and style sheets? Also, what type of problems might an author experience in the way of incompatibilities? For example, by: - browser type - OS - firewall settings - Antivirus settings - network administrator setting restrictions
18
3531
by: Andromeda | last post by:
I've been trying to add a tree menu to my website with some luck (more or less). I came across a script on simplythebest.net, but I seem to be having a problem with it... and since they have no help section, this has brought me here. The script can be found at http://simplythebest.net/scripts/DHTML_scripts/dhtml_script_100.html (no login or anything required... I just thought the script might be too long to repost here)
6
5244
by: Jon Davis | last post by:
I recently learned how to do an <OBJECT> alternative to <IFRAME> in current browsers using: <object id="extendedhtml" type="text/html" data="otherpage.html" width="250" height="400"></object> My question is how do I access the document DOM of this object in Javascript? For example, "alert(extendedhtml.innerHTML);" doesn't work and produces an unknown error. I'd like to both read and write to the document's body element's innerHTML...
5
1326
by: Antonio Ooi | last post by:
Hi, I'm an application developer from Malaysia. I wanted to know how ASP.NET server-side events vs. client-side DHTML for FORM manipulations, may be in terms of performance and practicality? To my understanding, server events will only work when user sends request to server. Any FORM object manipulations will need to go through the Web server, whereas for DHTML, the FORM objects are manipulated on the fly. The most beutiful thing of...
3
1434
by: Kevin Chabot | last post by:
Hi, Maybe some of you remember. In VB6 it was possible to create a Document ActiveX component. This would be an ActiveX EXE file, that can be loaded from a DHTML webpage (using <object> for example). Can a similar thing be done in VB.Net? I don't seem to find any resources to do this and it can't use ASP or something, it should be able to run from a local HTML file.
5
5281
by: gimme_this_gimme_that | last post by:
I'd like to create my own version of google suggest GS. If you haven't seen GS check it out at : http://www.google.com/webhp?complete=1&hl=en I've reviewed several AJAX write-ups on the internet and understand the issues around passing and fetching data from the client to the server. Well, at least as it's described in various tutorials.
1
2319
by: gimme_this_gimme_that | last post by:
What I need is the DHTML for an input box that allows javascript to add drop down entries. .... I'd like to create my own version of google suggest GS. If you haven't seen GS check it out at : http://www.google.com/webhp?complete=1&hl=en
2
3683
by: Questman | last post by:
Good afternoon, Does anyone have any code that implements, or approaches implementing, a cross-browser DHTML/JS solution to provide an Excel-like Grid on a web page - I'm trying to convert an old Java client/server data maintenance program to the web - the main display is in a grid format, which allows the user to select multiple rows and edit them in a new grid, which processes each grid line individually and validates and saves the...
4
1651
by: bbcrock | last post by:
I cannot seem to set a size for a text area relative to total screen width in CSS or HTML or Javascript? When I use CSS or a percent value in the cols attribute, they size the textarea as a percentage of another text area on the screen. thanks, Don
0
8341
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8751
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8539
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7360
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4176
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4342
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1982
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.