472,984 Members | 2,553 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,984 software developers and data experts.

Firefox browser style.display issue (IE works fine)

I have a dropdown which calls SetTimePeriod method on change the selection. In the JS function, I reset the field style.display based on what the selection is. This works fine with IE but not working with Firefox browser.

The firefox browser has problem to display a field after its style.display is reset. At the end of the JS function, I printed out the fields style.display value. They are set correctly. How to resovle this?

My JS is :

Expand|Select|Wrap|Line Numbers
  1. function SetTimePeriod(reportTimePeriod, reportTypeName, fromProfile) {
  2.        var odate = document.getElementById('odate'); // id for td
  3.        var sdate = document.getElementById('sdate'); // id for td      
  4.        var ddate = document.getElementById('ddate');  // id for div     
  5.        var startday = document.getElementById('startday');  // id for div            
  6.        var periodLabel = document.getElementById('periodLabel');  // id for td     
  7.        var periodList = document.getElementById('periodList');  // id for div            
  9.     if(condition){
  10.        periodLabel.style.display="none";
  11.        periodList.style.display="none";
  12.        ddate.style.display="block";       
  13.        startday.style.display="none";
  14.        odate.style.display="block";
  15.        sdate.style.display="none";
  16.    }else{
  17.        periodLabel.style.display="block";
  18.        periodList.style.display="block";
  19.         startday.style.display="none";
  20.         ddate.style.display="none";  
  21.         odate.style.display="none";
  22.         sdate.style.display="none";
  23.     }
  24.     alert(" SetTimePeriod - periodLabel = "+periodLabel.style.display+" - periodList = "+periodList.style.display+" - odate = "+odate.style.display+" - sdate="+sdate.style.display+" - ddate="+ddate.style.display+" - startday="+startday.style.display);
  25.   }
Sep 1 '06 #1
1 8955
16,027 Expert Mod 8TB
For a table cell (td element), the correct style.display setting is "table-cell". Unfortunately, this is not supported in IE which uses "block" instead.

To work around this, set style.display to the empty string "" which should set it to the default display.
May 9 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

by: prasaddevivara | last post by:
I am using the outerHTML property to modify the HTML of existin elements in a web page in Internet Explorer. But same outerHTM property is not working in firefox browser, Anybody can tell me a...
by: cjaserver | last post by:
This works fine in IE, but is breaking in Firefox, and reported in Netscape as well. I can't determine why. http://www.chartermainstreetgld.com click on the real estate section on the left nav...
by: Brian D | last post by:
Take a look at this page. http://tempsite.texwipe.com/test/ The code is too long to post here so just look at the source. It works flawlessly in IE, but in Firefox not so much. Here is the...
by: dmorand | last post by:
I have a page where I'm using ajax to retrieve some employee info when a user clicks a "Retrieve Employee Info" button. The issue I'm having is that when the user updates the employee info,...
by: Stever1975 | last post by:
I'm working on something similiar to a shopping cart item page. There is a table of items. Each item has an image, a textbox for the qty and an image for the add button. When the add image is...
by: oranoos3000 | last post by:
hi would you please help me i have a online shopping center that i show pictures of the my product in home page. in the InterExplorer pictures is shown correctly but in Firefox browser is shown...
by: Gary Canada | last post by:
I have some code that works fine in IE, and chrome but does not work in Mozilla Firefox... here is a simple example: <div id='something'></div> <script language = "javascript" type =...
by: DruidFluid | last post by:
Hello, I would greatly appreciate any advice. I have an issue with my Tumblr template being incompatible with the Firefox browser. I'm not exceptionally skilled at recognizing coding errors, so I...
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.