User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 402,728 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,424 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting

Checkbox has no properties in FireFox. Works fine in IE

Join Date: Jan 2007
Posts: 2,537
Reputation: MidiMagic is on a distinguished road 
Rep Power: 7
Solved Threads: 111
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Posting Maven

Re: Checkbox has no properties in FireFox. Works fine in IE

  #2  
Aug 25th, 2007
There are several possibilities, but I need to see more to tell what. The possibilities:

1. IE is not case sensitive for styles and tags. Firefox is case-sensitive. So, to be sure your ids and styles are compatible, make everything in your stylesheet and references lowercase.

2. It may depend on the browser whether it is looking for the name attribute or the id attribute. For Input boxes, it is best to provide both. But remember that all radio buttons in a group require the same name, but different ids.

3. Check for accidental capitalizations and typos.

4. Do you accidentally have two objects with the same id attribute? Do you have a different object with a name attribute which is the same as the id attribute you are using?

5. Remember that the checked attribute is boolean.

6. Are the contents of the variable x known to be a string? If not, are they known to be an integer? You may have an issue with roundoff error if the value is calculated.

7. Did you return x from a function? If so, it may be that you used a parameter passing method that returns a value on one browser, but not on another.

8. How did you declare x? It may be that, under the rules of one browser, x is outside its scope.

9. Could x have a leading blank for some reason?

10. I was told to use single quites for JavaScript strings, and double quotes for html attributes. I don't think this is a hard rule, but it might be confusing something.

Try doing this:

strig = 'type_' + x;
alert(strig);
alert(document.getElementById(strig).checked);

Look at strig and see what it really is.
Last edited by MidiMagic : Aug 25th, 2007 at 8:04 pm.
Daylight-saving time uses more gasoline
Reply With Quote  
All times are GMT -4. The time now is 6:58 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC