|
Тема |
Javascript IE7 проблем |
|
Автор |
Nebesen1 (stubborn) |
|
Публикувано | 06.02.07 12:10 |
|
|
Здравейте
от скоро уча джаваскрипт и писах един код, който взима стойностите от клетки от таблица, която извеждам чрез php и mysql. Та значи имам таблица с попълнени полета и няколко празни, където се смятат различни сборни стойности. Ето го и кода :
В отговор на:
<script type="text/javascript">
search = window.location.href.substr( window.location.href.indexOf( "&count=" ) + 1 )
count=search.substr(6);
var sum;
function calc2()
{
var neto=0
for (g = 1; g < count; g++)
{
if (parseInt(document.getElementById('r'+g).value) >= 0)
{
fira = parseFloat(document.getElementById("outgo_fira").value);
amount = parseFloat(document.getElementById("amount").value);
proda = parseFloat(document.getElementById('r'+g).value);
sum_fira=parseFloat(proda+(proda*(fira/100)));
document.getElementById('f'+g).innerHTML = sum_fira.toFixed(2) + ' лв.';
sum = parseFloat(((amount*proda)*fira/100)+(amount*proda));
document.getElementById('a'+g).innerHTML = sum.toFixed(2) + ' лв.';
price=document.getElementById('p'+g).value;
sum_calc=parseFloat(sum*price);
document.getElementById('c'+g).innerHTML = sum_calc.toFixed(2) + ' лв.';
neto=neto + sum_calc;
}
}
amount=document.getElementById("amount").value;
montaj_fira=parseFloat(document.getElementById("montaj_fira").value);
montaj_amount=parseFloat(amount*montaj_fira);
document.getElementById("montaj_amount").innerHTML=montaj_amount.toFixed(2) + ' лв.';
montaj_cena=parseFloat(document.getElementById("montaj_cena").value);
montaj_sum=parseFloat(montaj_amount*montaj_cena);
document.getElementById("montaj_sum").innerHTML=montaj_sum.toFixed(2) + ' лв.';
neto=parseFloat(neto+montaj_sum);
document.getElementById("neto").innerHTML=neto.toFixed(2) + ' лв.';
document.getElementById("single").innerHTML=(neto/amount).toFixed(2) + ' лв.';
document.getElementById("neto_dds").innerHTML=(neto*(20/100)).toFixed(2) + ' лв.';
document.getElementById("single_dds").innerHTML=((neto/amount)*(120/100)).toFixed(2) + ' лв.';
document.getElementById("final_sum").innerHTML=(neto*(120/100)).toFixed(2) + ' лв.';
document.getElementById("final_count").innerHTML=amount;
}
</script>
Не съм постнал php кода, защото може да се объркате, но ако трябва - няма проблеми, само кажете.
Кодът работи без проблеми във ФФ, но под ИЕ - не. Можете ли да помогнете ?
Just do it
|
| |
|
|
|