Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [JavaScript][HTML] Update pola DIV
Kao
post
Post #1





Grupa: Zarejestrowani
Postów: 26
Pomógł: 0
Dołączył: 19.10.2004
Skąd: Zgorzelec

Ostrzeżenie: (0%)
-----


Witam
Już mam dosyć szukania ... jak to zrobić ... może mała podpowiedź co robię źle.
Mianowicie mam taki oto kod:
  1. <script language="JavaScript">
  2.  
  3. function pomnoz(mnozna, mnoznik, laminat, netto, brutto)
  4. {
  5. var netto, brutto = 0;
  6.  
  7. var mnozna = document.getElementById(mnozna).value;
  8. var mnoznik = document.getElementById(mnoznik).value;
  9.  
  10. if (document.getElementById(laminat).checked) laminat = 10;
  11. else laminat = 0;
  12.  
  13. var wynik = (parseInt(mnozna) * parseInt(mnoznik) * (32 + laminat))/10000;
  14.  
  15. var netto = Math.round(wynik*Math.pow(10,2))/Math.pow(10,2);
  16. document.getElementById(netto).innerHTML=netto;
  17.  
  18. var brutto = Math.round((netto*1.22)*Math.pow(10,2))/Math.pow(10,2);
  19. document.getElementById(brutto).innerHTML=brutto;
  20. }
  21.  
  22.  
  23. <b>--Kalkulator--</b><br>
  24. Proszę podać<br>
  25. szerokość: <input type="text" size="10" id="szer" onchange="pomnoz('szer', 'wys', 'lam', 'netto', 'brutto')" name="szer"> cm<br>
  26. wysokość: <input type="text" size="10" id="wys" onchange="pomnoz('szer', 'wys', 'lam', 'netto', 'brutto')" name="wys"> cm<br>
  27. Laminowanie: <input type="checkbox" id="lam" onclick="pomnoz('szer', 'wys', 'lam','netto', 'brutto')" name="lam"><br>
  28. Cena: <div id="netto" style="display: inline;">0</div> zł netto<br>
  29. Cena: <div id="brutto" style="display: inline;">0</div> zł brutto<br>


Proszę powiedzieć czemu nie aktualizuje pola div z ceną ?(mówię od razu że nie chcę mieć zamiast div pola INPUT (IMG:style_emoticons/default/exclamation.gif) )
Ja już sił nie mam:<

Pozdr.
Kao

Ten post edytował Kao 15.02.2010, 08:32:01
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 23.08.2025 - 06:28