473,386 Members | 1,785 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Firefox bug?

Hi,

to implement search by javascript function I use this code:

==============
function filterContacts(term, _id, cellNr){

var s = term.value.toLowerCase();
var table = document.getElementById(_id);
var ele;

for (var r = 0; r < table.rows.length; r++){
table.rows[r].style.display = 'none';
}
for (var r = 0; r < table.rows.length; r++){
ele = null;
if (table.rows[r] != null && table.rows[r].cells[cellNr] != null){
ele = table.rows[r].cells[cellNr].innerHTML;
if (ele.toLowerCase().indexOf(s)<0 ) {
table.rows[r].style.display = 'none';
} else {
table.rows[r].style.display = 'block';
}
}
}

}

===============

This works fine in IE,
but there are some bugs in Firefox.
There are a style.display bugs in firefox?

Thanks for any suggestion.
fabio

Apr 25 '07 #1
2 3466
"Fabio Maggi" <fa*****@tin.itwrote:
for (var r = 0; r < table.rows.length; r++){
ele = null;
if (table.rows[r] != null && table.rows[r].cells[cellNr] != null){
ele = table.rows[r].cells[cellNr].innerHTML;
if (ele.toLowerCase().indexOf(s)<0 ) {
table.rows[r].style.display = 'none';
} else {
table.rows[r].style.display = 'block';
}
}
}

}

===============

This works fine in IE,
but there are some bugs in Firefox.
There are a style.display bugs in firefox?
There probably are, but the bug here is in your code not Firefox.

don't try to set table rows to 'block' display style (except in the
Microsoft universe table rows have a 'table-row' display style): just clear
the display style to make it visible on all browsers:
} else {
table.rows[r].style.display = '';
}
Apr 26 '07 #2
Fabio Maggi a écrit :
Hi,

to implement search by javascript function I use this code:

==============
function filterContacts(term, _id, cellNr){

var s = term.value.toLowerCase();
What is term? A reference to an input or the name attribute of an input?
Firefox and IE6+ do not work the same way on referencing form input
controls.

Visit section 3.2 of this page:
Using Web Standards in your Web Pages
3.2 Accessing Elements with the W3C DOM
http://developer.mozilla.org/en/docs...your_Web_Pages
var table = document.getElementById(_id);
var ele;

for (var r = 0; r < table.rows.length; r++){
table.rows[r].style.display = 'none';
}
for (var r = 0; r < table.rows.length; r++){
ele = null;
if (table.rows[r] != null && table.rows[r].cells[cellNr] != null){
ele = table.rows[r].cells[cellNr].innerHTML;
if (ele.toLowerCase().indexOf(s)<0 ) {
table.rows[r].style.display = 'none';
} else {
table.rows[r].style.display = 'block';

For CSS 2.1 compliant browsers, the default display value of row element
is table-row. MSIE 6 and MSIE 7 do not support display: table-row. So
IE6+ has bugs, CSS 2.x bugs.
Also, MSIE 6 and MSIE 7 do not support visibility: collapse for table
rows and table columns; so again, MSIE 6+ has the bugs. Firefox 2
supports visibility: collapse for table rows.

Gérard
--
Using Web Standards in your Web Pages (Updated Dec. 2006)
http://developer.mozilla.org/en/docs...your_Web_Pages
Apr 26 '07 #3

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

Similar topics

3
by: Jeremy Epstein | last post by:
I've got a 4-page form that lets users enter a whole lot of information, which is then submitted and emailed at the end. All the fields are stored as session data. The whole thing works fine: ...
87
by: expertware | last post by:
Dear friends, My name is Pamela, I know little about CSS, but I would like to ask a question I have an image on a web page within a css layer: <DIV ID=MyLayer STYLE = "position:...
14
by: expertware | last post by:
Ok! to avoid confusion I will start a new argument. Thanks!! FIREFOX 1.0.7 AND IE6 viewed through DATATIME: a summary REPORT ===============================================================...
5
by: SPE - Stani's Python Editor | last post by:
Hi, During optimizing SPE for Ubuntu, I found something strange. I have Ubuntu 5.10 "The Breezy Badger" and unfortunately this code is not working: >>> import webbrowser >>>...
7
by: Coder | last post by:
Hi I have the following code in java script, it is not giving proper output in FIREFOX but running fine in IE... can anybody help me out to make this run in FIREFOX . <script...
12
by: amit | last post by:
Hello group, I'm kinda skeptical about a code is being used in my js program. All it does is checking what browser is being run and finds out if FLASH is installed or not. This code works...
6
by: scotty | last post by:
I have a script that loops through an existing table list and prepares each href element node to trigger a function when an image is clicked. The function that will be run passes a property value...
7
by: Carlos Mendonça | last post by:
Has anyone managed to get ClickOnce to work with Firefox? It seems to me that it still has the same issues VS 2K5 had. I appreciate any comments or tips.
3
by: SAL | last post by:
Hello, I did google this issue and found some stuff related to BrowserCaps section of either web.config or machine.config but it didn't work. It seems that most pages in my webapp are okay but a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...

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.