473,320 Members | 1,829 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,320 software developers and data experts.

for loop doesn`t work fine on Firefox

MZ

Hello!

The following js code doesn`t work fine on Firefox and I don`t know why.
I have table with 30 rows and on IE I click once on analyse button and it
fills my cells automaticaly, but
when I click the same analyse button on Firefox it fills me only one row and
force me to click 30 times to fill the whole table.

I replaced js break; into js continue; but it didn`t help me.

Could you help me fix the problem?
Marcin

<input type="button" value="Analizuj" name="analizuj" class="btn"
id="analizuj"
onClick="analiza_na_podstawie_poprzedniego_tygodni a('form_nowe_notowanie');">

---------------------------------------------------------------------------------------------------
for (var
m=1;m<=parseInt(document.getElementById('ilosc_poz ycji_juz_wygenerowanych').value);m++)
{
if (document.getElementById('notowanie_szacowane').va lue=='T')
{
document.getElementById('pozycja_poprzednia_new'+m ).value=document.getElementById('pozycja_aktualna_ new'+m).value;
}

if
((parseInt(document.getElementById('pozycja_poprze dnia_new'+m).value)!=0) &&
(document.getElementById('artysta_new'+m).value==' ') &&
(document.getElementById('utwor_new'+m).value=='') )
{
for
(n=1;n<=document.getElementById('ilosc_pozycji_juz _wygenerowanych_old').value;n++)
{
krotnosc_ilosc=0;
for
(v=1;v<=parseInt(document.getElementById('ilosc_po zycji_juz_wygenerowanych_old').value);v++)
{
if (document.getElementById('notowanie_szacowane_old' ).value=='T')
{
if
(document.getElementById('pozycja_poprzednia_old'+ n).value==document.getElementById('pozycja_poprzed nia_old'+v).value)
{
krotnosc_ilosc=krotnosc_ilosc+1;
}
}
else
{
if
(document.getElementById('pozycja_aktualna_old'+n) .value==document.getElementById('pozycja_aktualna_ old'+v).value)
{
krotnosc_ilosc=krotnosc_ilosc+1;
}
}
}

if (
(
(document.getElementById('notowanie_szacowane_old' ).value!='T') &&
(parseInt(document.getElementById('pozycja_aktualn a_old'+n).value)==parseInt(document.getElementById ('pozycja_poprzednia_new'+m).value))
)
||
(
(document.getElementById('notowanie_szacowane_old' ).value=='T') &&
(parseInt(document.getElementById('pozycja_poprzed nia_old'+n).value)==parseInt(document.getElementBy Id('pozycja_poprzednia_new'+m).value))
)
)
{
if (krotnosc_ilosc==1)
{
if (m>1)
{
if
((document.getElementById('utwor_old'+n).value!=do cument.getElementById('utwor_new'+(m-1)).value)
||
(document.getElementById('artysta_old'+n).value!=d ocument.getElementById('artysta_new'+(m-1)).value))
{
document.getElementById('utwor_new'+m).value=docum ent.getElementById('utwor_old'+n).value;
document.getElementById('artysta_new'+m).value=doc ument.getElementById('artysta_old'+n).value;
if (document.getElementById('butt').value!='Aktualizu j dane')
{
document.getElementById('id_new_old'+m).value=docu ment.getElementById('id_old'+n).value;
document.getElementById('artysta_new_old'+m).value =document.getElementById('artysta_old'+n).value;
document.getElementById('utwor_new_old'+m).value=d ocument.getElementById('utwor_old'+n).value;
}
}
}
else
{
document.getElementById('utwor_new'+m).value=docum ent.getElementById('utwor_old'+n).value;
document.getElementById('artysta_new'+m).value=doc ument.getElementById('artysta_old'+n).value;
if (document.getElementById('butt').value!='Aktualizu j dane')
{
document.getElementById('id_new_old'+m).value=docu ment.getElementById('id_old'+n).value;
document.getElementById('artysta_new_old'+m).value =document.getElementById('artysta_old'+n).value;
document.getElementById('utwor_new_old'+m).value=d ocument.getElementById('utwor_old'+n).value;
}
}

continue;
}
else
{
if (confirm("Czy chcesz dodac do pozycji
"+document.getElementById('pozycja_aktualna_new'+m ).value+ " :
"+document.getElementById('artysta_old'+n).val ue+" -
"+document.getElementById('utwor_old'+n).value +" ?"))
{
if (m>1)
{
if
((document.getElementById('utwor_old'+n).value!=do cument.getElementById('utwor_new'+(m-1)).value)
||
(document.getElementById('artysta_old'+n).value!=d ocument.getElementById('artysta_new'+(m-1)).value))

{
document.getElementById('utwor_new'+m).value=docum ent.getElementById('utwor_old'+n).value;
document.getElementById('artysta_new'+m).value=doc ument.getElementById('artysta_old'+n).value;
continue;
if (document.getElementById('butt').value!='Aktualizu j dane')
{
document.getElementById('id_new_old'+m).value=docu ment.getElementById('id_old'+n).value;
document.getElementById('artysta_new_old'+m).value =document.getElementById('artysta_old'+n).value;
document.getElementById('utwor_new_old'+m).value=d ocument.getElementById('utwor_old'+n).value;
}

}
}
else
{
document.getElementById('utwor_new'+m).value=docum ent.getElementById('utwor_old'+n).value;
document.getElementById('artysta_new'+m).value=doc ument.getElementById('artysta_old'+n).value;
continue;
if (document.getElementById('butt').value!='Aktualizu j dane')
{
document.getElementById('id_new_old'+m).value=docu ment.getElementById('id_old'+n).value;
document.getElementById('artysta_new_old'+m).value =document.getElementById('artysta_old'+n).value;
document.getElementById('utwor_new_old'+m).value=d ocument.getElementById('utwor_old'+n).value;
}
}
}
else
{
alert("Pozycja nie zostala dodana");
}
}

}
}

}

}

Apr 23 '07 #1
6 2107
MZ said the following on 4/23/2007 4:18 PM:
Hello!

The following js code doesn`t work fine on Firefox and I don`t know why.
Post a URL to a page so it can be viewed. Without seeing the
accompanying HTML it is impossible to tell. And, I can not speak for
anyone else, but I don't care to try to guess what the HTML looks like
to try to debug that script.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Apr 23 '07 #2
K.

Uzytkownik "Randy Webb" <Hi************@aol.comnapisal w wiadomosci
news:1d********************@giganews.com...
MZ said the following on 4/23/2007 4:18 PM:
>Hello!

The following js code doesn`t work fine on Firefox and I don`t know why.

Post a URL to a page so it can be viewed. Without seeing the accompanying
HTML it is impossible to tell. And, I can not speak for anyone else, but I
don't care to try to guess what the HTML looks like to try to debug that
script.

--
Please take a look at:

http://www.zmyslowski.pl/MZ_CRM/

login: user
passw: test123

Then you have to go to the following links:

Lista Przebojow->Lista Przebojow Programu III Polskiego Radia (1-30)-Dodaj
nowe notowania->
then click on "Tworz liste" and then please fill "POZ. -7" column on the
right table. Please fill this column by typing 1 for "Poz. akt." = 1,
2 for "Poz. akt" = 2. and so on till 30.

So it will look like:

Poz. akt Poz -7 Artysta Utwor
1 1
2 2
3 3
..... ...
30 30

After clicking on "Analizuj" button it should works the same as on IE that
is:
Poz. -7 on the right table should read Poz. akt from the left table and
after reading
it should fill Artysta & Utwor columns automaticaly.

I hope I will explain you fine what I mean.

Thank you in advance for help
Marcin
Apr 24 '07 #3
K. wrote:
Uzytkownik "Randy Webb" <Hi************@aol.comnapisal w wiadomosci
news:1d********************@giganews.com...
>MZ said the following on 4/23/2007 4:18 PM:
>>Hello!

The following js code doesn`t work fine on Firefox and I don`t know why.
Post a URL to a page so it can be viewed. Without seeing the accompanying
HTML it is impossible to tell. And, I can not speak for anyone else, but I
don't care to try to guess what the HTML looks like to try to debug that
script.

--

Please take a look at:

http://www.zmyslowski.pl/MZ_CRM/

login: user
passw: test123

Then you have to go to the following links:

Lista Przebojow->Lista Przebojow Programu III Polskiego Radia (1-30)-Dodaj
nowe notowania->
then click on "Tworz liste" and then please fill "POZ. -7" column on the
right table. Please fill this column by typing 1 for "Poz. akt." = 1,
2 for "Poz. akt" = 2. and so on till 30.

So it will look like:

Poz. akt Poz -7 Artysta Utwor
1 1
2 2
3 3
.... ...
30 30

After clicking on "Analizuj" button it should works the same as on IE that
is:
Poz. -7 on the right table should read Poz. akt from the left table and
after reading
it should fill Artysta & Utwor columns automaticaly.

I hope I will explain you fine what I mean.
document.getElementById("butt") has no properties
http://www.zmyslowski.pl/MZ_CRM/inde...l2=dodajnowalp
Line 111
Thank you in advance for help
Sure. Now teach me Polish.

--
-Lost
Remove the extra words to reply by e-mail. Don't e-mail me. I am
kidding. No I am not.
Apr 24 '07 #4
-Lost wrote:
K. wrote:
>Uzytkownik "Randy Webb" <Hi************@aol.comnapisal w wiadomosci
news:1d********************@giganews.com...
>>MZ said the following on 4/23/2007 4:18 PM:
Hello!

The following js code doesn`t work fine on Firefox and I don`t know
why.
Post a URL to a page so it can be viewed. Without seeing the
accompanying HTML it is impossible to tell. And, I can not speak for
anyone else, but I don't care to try to guess what the HTML looks
like to try to debug that script.

--

Please take a look at:

http://www.zmyslowski.pl/MZ_CRM/

login: user
passw: test123

Then you have to go to the following links:

Lista Przebojow->Lista Przebojow Programu III Polskiego Radia (1-30)->
Dodaj nowe notowania->
then click on "Tworz liste" and then please fill "POZ. -7" column on
the right table. Please fill this column by typing 1 for "Poz. akt." = 1,
2 for "Poz. akt" = 2. and so on till 30.

So it will look like:

Poz. akt Poz -7 Artysta Utwor
1 1
2 2
3 3
.... ...
30 30

After clicking on "Analizuj" button it should works the same as on IE
that is:
Poz. -7 on the right table should read Poz. akt from the left table
and after reading
it should fill Artysta & Utwor columns automaticaly.

I hope I will explain you fine what I mean.

document.getElementById("butt") has no properties
http://www.zmyslowski.pl/MZ_CRM/inde...l2=dodajnowalp

Line 111
>Thank you in advance for help

Sure. Now teach me Polish.
Oops, I pasted the wrong thing.

I think you are running into problems in your using parseInt on
"losc_pozycji_juz_wygenerowanych" and several other FORM element values
that you retrieve via getElementById.

It appears to be a FORM element which could easily be retrieved from a
collection.

I think you need to reevalute
"analiza_na_podstawie_poprzedniego_tygodnia." I cannot possibly tell
why you have so much code to iterate values from one side of the page to
a collection of FORM INPUTs anyway.

--
-Lost
Remove the extra words to reply by e-mail. Don't e-mail me. I am
kidding. No I am not.
Apr 24 '07 #5
K.

Uzytkownik "-Lost" <ma****************@techie.comnapisal w wiadomosci
news:jc******************************@comcast.com. ..
-Lost wrote:
>K. wrote:
>>Uzytkownik "Randy Webb" <Hi************@aol.comnapisal w wiadomosci
news:1d********************@giganews.com...
MZ said the following on 4/23/2007 4:18 PM:
Hello!
>
The following js code doesn`t work fine on Firefox and I don`t know
why.
Post a URL to a page so it can be viewed. Without seeing the
accompanying HTML it is impossible to tell. And, I can not speak for
anyone else, but I don't care to try to guess what the HTML looks like
to try to debug that script.

--

Please take a look at:

http://www.zmyslowski.pl/MZ_CRM/

login: user
passw: test123

Then you have to go to the following links:

Lista Przebojow->Lista Przebojow Programu III Polskiego Radia (1-30)->
Dodaj nowe notowania->
then click on "Tworz liste" and then please fill "POZ. -7" column on the
right table. Please fill this column by typing 1 for "Poz. akt." = 1,
2 for "Poz. akt" = 2. and so on till 30.

So it will look like:

Poz. akt Poz -7 Artysta Utwor
1 1
2 2
3 3
.... ...
30 30

After clicking on "Analizuj" button it should works the same as on IE
that is:
Poz. -7 on the right table should read Poz. akt from the left table and
after reading
it should fill Artysta & Utwor columns automaticaly.

I hope I will explain you fine what I mean.

document.getElementById("butt") has no properties
http://www.zmyslowski.pl/MZ_CRM/inde...l2=dodajnowalp
Line 111
>>Thank you in advance for help

Sure. Now teach me Polish.

Oops, I pasted the wrong thing.

I think you are running into problems in your using parseInt on
"losc_pozycji_juz_wygenerowanych" and several other FORM element values
that you retrieve via getElementById.

It appears to be a FORM element which could easily be retrieved from a
collection.

I think you need to reevalute
"analiza_na_podstawie_poprzedniego_tygodnia." I cannot possibly tell why
you have so much code to iterate values from one side of the page to a
collection of FORM INPUTs anyway.

--
-Lost
Remove the extra words to reply by e-mail. Don't e-mail me. I am
kidding. No I am not.

I have checked. Now everything work fine. It was a problem with
getElementById.
I had to change if php to show input field.

Thanks for help
Marcin
Apr 24 '07 #6
K. wrote:
Uzytkownik "-Lost" <ma****************@techie.comnapisal w wiadomosci
news:jc******************************@comcast.com. ..
>-Lost wrote:
>>K. wrote:
Uzytkownik "Randy Webb" <Hi************@aol.comnapisal w wiadomosci
news:1d********************@giganews.com...
MZ said the following on 4/23/2007 4:18 PM:
>Hello!
>>
>The following js code doesn`t work fine on Firefox and I don`t know
>why.
Post a URL to a page so it can be viewed. Without seeing the
accompanying HTML it is impossible to tell. And, I can not speak for
anyone else, but I don't care to try to guess what the HTML looks like
to try to debug that script.
>
--
Please take a look at:

http://www.zmyslowski.pl/MZ_CRM/

login: user
passw: test123

Then you have to go to the following links:

Lista Przebojow->Lista Przebojow Programu III Polskiego Radia (1-30)->
Dodaj nowe notowania->
then click on "Tworz liste" and then please fill "POZ. -7" column on the
right table. Please fill this column by typing 1 for "Poz. akt." = 1,
2 for "Poz. akt" = 2. and so on till 30.

So it will look like:

Poz. akt Poz -7 Artysta Utwor
1 1
2 2
3 3
.... ...
30 30

After clicking on "Analizuj" button it should works the same as on IE
that is:
Poz. -7 on the right table should read Poz. akt from the left table and
after reading
it should fill Artysta & Utwor columns automaticaly.

I hope I will explain you fine what I mean.
document.getElementById("butt") has no properties
http://www.zmyslowski.pl/MZ_CRM/inde...l2=dodajnowalp
Line 111

Thank you in advance for help
Sure. Now teach me Polish.
Oops, I pasted the wrong thing.

I think you are running into problems in your using parseInt on
"losc_pozycji_juz_wygenerowanych" and several other FORM element values
that you retrieve via getElementById.

It appears to be a FORM element which could easily be retrieved from a
collection.

I think you need to reevalute
"analiza_na_podstawie_poprzedniego_tygodnia." I cannot possibly tell why
you have so much code to iterate values from one side of the page to a
collection of FORM INPUTs anyway.

--
-Lost
Remove the extra words to reply by e-mail. Don't e-mail me. I am
kidding. No I am not.


I have checked. Now everything work fine. It was a problem with
getElementById.
I had to change if php to show input field.

Thanks for help
Not a problem.

--
-Lost
Remove the extra words to reply by e-mail. Don't e-mail me. I am
kidding. No I am not.
Apr 24 '07 #7

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

Similar topics

5
by: Paxton | last post by:
I created an html email containing a form whose method is POST. The form is posted to an asp page for processing, but no values are retrieved. So I response.write all the Request.Form fields, and...
9
by: lkrubner | last post by:
I've got a function, you can see it below, that is being called onmouseup in the textarea on my main form. The idea is to find a selection if possible and store that text in a global variable. I...
3
by: niconedz | last post by:
Hi The following code works fine in IE but not Firefox. It's a little script that zooms an image and resizes the window to fit. Can anybody tell me what's wrong? Thanks Nico == btw.....
45
by: Pat | last post by:
its seems asp.net validation doesn't fire when using FireFox? Tested a page and it doesn't fire. It seems the javascript doesn't fire Any ideas?
5
by: Tyler Carver | last post by:
I have found a situation where the DefaultButton and DefaultFocus stop working under FireFox. I'm looking for any kind of fix or work around. The problem seems to happen when setting a control...
2
by: d3vkit | last post by:
Okay so I can NOT get my while loop to work. It's the most confusing thing I've ever come across. It was working fine and then suddenly, nothing. No error. The page just dies. I am using PHP5 with...
2
by: OBAFGKM_RNS | last post by:
Let's say I have a Javascript function that loops over and over. In that function i have it alternating images on a button this way: if(var==0){ var myHTML = "<input type='button'...
7
by: John Kotuby | last post by:
Hi all, I have created an ASPX page in VS 2008 that appears inside of an IFRAME inside a standard HTML page. Because it loads from an external site and is database driven, the first load takes a...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.