title: Submit Value from price calculator
body: <p>I have an order form that should filled with identity and price calculated with javascript. But I have no idea how to submit the calculated value to php file.
  This is the code :</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;html&gt;
  &lt;head&gt;&lt;title&gt;&lt;/title&gt;
  &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;table width="1020"&gt;
    &lt;form action="kirim.php" method="POST" &gt;
      &lt;tr&gt;
        &lt;td colspan="2"&gt;&lt;h2&gt;Form Pemesanan&lt;/h2&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td width="80"&gt;Nama&lt;/td&gt;
        &lt;td&gt;&lt;input name="nama" type="text" id="nama" size="30" required="true"&gt;&lt;/td&gt;
      &lt;/tr&gt;
     &lt;tr&gt;
        &lt;td&gt;Nomor HP&lt;/td&gt;
        &lt;td&gt;&lt;input name="nomor" type="text" id="nomor" size="30" required="true"&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;&lt;p&gt;Email&lt;/p&gt; &lt;/td&gt;
        &lt;td&gt;&lt;input name="email" type="text" id="email" size="30" required="true"&gt;&lt;/td&gt;
      &lt;/tr&gt;
   &lt;tr&gt;
   &lt;td&gt;&lt;/td&gt;
   &lt;td&gt;&lt;center&gt;Nama Server&lt;/center&gt;&lt;/td&gt;&lt;td&gt;&lt;center&gt;Masa Aktif&lt;/center&gt;&lt;/td&gt;&lt;td&gt;&lt;center&gt;Jumlah (Rp.)&lt;/center&gt;&lt;/td&gt;&lt;td&gt;&lt;center&gt;Diskon (Rp.)&lt;/center&gt;&lt;/td&gt;
   &lt;tr&gt;
     &lt;td&gt;Server&lt;/td&gt;
     &lt;td&gt;
    &lt;input type="checkbox" name="server1" value="SSH AMERIKA (Nodes Direct)"&gt;SSH AMERIKA (Nodes Direct)
     &lt;/td&gt;
     &lt;td width="450"&gt;
      &lt;input onclick="hitung(this.value)" type="radio" id="a1" name="serverr1" value="10000"&gt;1 bulan
      &lt;input onclick="hitung(this.value)" type="radio" id="a2" name="serverr1" value="25000"&gt;3 bulan
      &lt;input onclick="hitung(this.value)" type="radio" id="a3" name="serverr1" value="50000"&gt;6 bulan
      &lt;input onclick="hitung(this.value)" type="radio" id="a4" name="serverr1" value="75000"&gt;9 bulan
      &lt;input onclick="hitung(this.value)" type="radio" id="a5" name="serverr1" value="100000"&gt;12 bulan&lt;/td&gt;
      &lt;td width="120" id="amerika"&gt;&lt;/td&gt;
      &lt;td width="100" id="amerika2"&gt;&lt;/td&gt;
     &lt;tr&gt;
    &lt;/form&gt;
  &lt;/table&gt;
  
  &lt;script&gt;
  var harga=0, harga2=0, harga3=0, harga4=0, hargasementara=0, hargasementara2=0, hargasementara3=0, hargasementara4=0;
  //------------------------------------------------------HITUNG RADIO BUTTON 1-----------------------------------------------
  function hitung(){
  var hargasementara;
  if (document.getElementById('a1').checked) {
  hargasementara=10000;
  harga=document.getElementById('a1').value;
  }
  else if (document.getElementById('a2').checked){
  hargasementara=30000;
  harga=document.getElementById('a2').value;
  } else if (document.getElementById('a3').checked){
  hargasementara=60000;
  harga=document.getElementById('a3').value;
  }
  else if (document.getElementById('a4').checked){
  hargasementara=90000;
  harga=document.getElementById('a4').value;
  }
  else if (document.getElementById('a5').checked) {
  hargasementara=120000;
  harga=document.getElementById('a5').value;
  }
  else {
  hargasementara=0;
  }
  document.getElementById("amerika").innerHTML = hargasementara;
  document.getElementById("amerika2").innerHTML = hargasementara-harga;
  akhir();
  }
  //------------------------------------------------------HITUNG RADIO BUTTON 2-----------------------------------------------
  function hitung2(){
  var hargasementara2;
  if (document.getElementById('i1').checked) {
  hargasementara2=15000;
  harga2=document.getElementById('i1').value;
  }
  else if (document.getElementById('i2').checked) {
  hargasementara2=45000;
  harga2=document.getElementById('i2').value;
  } else if (document.getElementById('i3').checked) {
  hargasementara2=90000;
  harga2=document.getElementById('i3').value;
  } else if (document.getElementById('i4').checked) {
  hargasementara2=135000;
  harga2=document.getElementById('i4').value;
  } else if (document.getElementById('i5').checked) {
  hargasementara2=180000;
  harga2=document.getElementById('i5').value;
  } else {
  hargasementara2=0;
  }
  document.getElementById("indonesia").innerHTML = hargasementara2;
  document.getElementById("indonesia2").innerHTML = hargasementara2-harga2;
  akhir();
  }
  //------------------------------------------------------HITUNG RADIO BUTTON 3-----------------------------------------------
  function hitung3(){
  var hargasementara3;
  if (document.getElementById('s1').checked) {
  hargasementara3=15000;
  harga3=document.getElementById('s1').value;
  }
  else if (document.getElementById('s2').checked) {
  hargasementara3=45000;
  harga3=document.getElementById('s2').value;
  } else if (document.getElementById('s3').checked) {
  hargasementara3=90000;
  harga3=document.getElementById('s3').value;
  } else if (document.getElementById('s4').checked) {
  hargasementara3=135000;
  harga3=document.getElementById('s4').value;
  } else if (document.getElementById('s5').checked) {
  hargasementara3=180000;
  harga3=document.getElementById('s5').value;
  } else {
  hargasementara3=0;
  }
  document.getElementById("singapura").innerHTML = hargasementara3;
  document.getElementById("singapura2").innerHTML = hargasementara3-harga3;
  akhir();
  }
  //------------------------------------------------------HITUNG RADIO BUTTON 4-----------------------------------------------
  function hitung4(){
  var hargasementara4;
  if (document.getElementById('ss1').checked) {
  hargasementara4=20000;
  harga4=document.getElementById('ss1').value;
  }
  else if (document.getElementById('ss2').checked) {
  hargasementara4=60000;
  harga4=document.getElementById('ss2').value;
  } else if (document.getElementById('ss3').checked) {
  hargasementara4=120000;
  harga4=document.getElementById('ss3').value;
  } else if (document.getElementById('ss4').checked) {
  hargasementara4=180000;
  harga4=document.getElementById('ss4').value;
  } else if (document.getElementById('ss5').checked) {
  hargasementara4=240000;
  harga4=document.getElementById('ss5').value;
  } else {
  hargasementara4=0;
  }
  document.getElementById("singapuraa").innerHTML = hargasementara4;
  document.getElementById("singapuraa2").innerHTML = hargasementara4-harga4;
  akhir();
  }
  
  function akhir(){
  hargaakhir=harga*1+harga2*1+harga3*1+harga4*1;
  document.getElementById("jumlah").innerHTML = hargaakhir;
  }
  &lt;/script&gt;
  &lt;p&gt; Jumlah Total Setelah Diskon:&lt;/p&gt;
  &lt;p id="jumlah"&gt;&lt;/p&gt;
  
  &lt;/body&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>So, I want hargaakhir variable (result of calculation) is submitted with the form to kirim.php</p>
  
  <p>Thanks before,</p>