Announcement

Collapse
No announcement yet.

How multiply with javascript

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How multiply with javascript

    Hello,

    How do we multiply 2 field values into one field in one form using javascript. I used this script, but it did not work.

    function sc_totalharga_onclick()
    {
    var jumlah = document.getElementById('jumlah').value;
    var harga = document.getElementById('harga').value;

    var sum = parseInt(jumlah) + parseInt(harga);
    document.write(sum);

    }

    Thank you



  • #2
    You must do it like tell guide SC: document.F1.humlah.value * document.F1.harga.value;

    Comment

    Working...
    X