Note that there are some explanatory texts on larger screens.

plurals
  1. POJquery/PHP: Result of jQuery function into PHP variable
    text
    copied!<p>I have a little question about Java and PHP. I didn't find what i was looking for in this forum so i think its better to ask.</p> <p>I have a Javascript function (see below) and not made myself! that automatically counts and makes a total price when the customer is changing multi choice buttons.</p> <pre><code>function fncCheck() { var subtotaal = 0; var combikorting = 0; var totaal = 0; var toeslagcontant = 0; var totaaltebetalen = 0; if (document.getElementById("ek").checked == true &amp;&amp; document.getElementById("epc").checked == false) { subtotaal = subtotaal + 115; toeslagcontant = 5; document.getElementById("elektrischekeuring").style.display = "block"; } else { document.getElementById("elektrischekeuring").style.display = "none"; } if (document.getElementById("ek").checked == true &amp;&amp; document.getElementById("epc").checked == true) { subtotaal = subtotaal + 125; toeslagcontant = 5; document.getElementById("elektrischekeuring").style.display = "block"; } else { document.getElementById("elektrischekeuring").style.display = "none"; } if (document.getElementById("epc").checked == true) { if (document.getElementById("studio").checked == true) { subtotaal = subtotaal + 115; } else if (document.getElementById("appartement").checked == true) { subtotaal = subtotaal + 140; } else if (document.getElementById("rijwoning").checked == true) { subtotaal = subtotaal + 165; } else if (document.getElementById("halfopenwoning").checked == true) { subtotaal = subtotaal + 165; } else if (document.getElementById("vrijstaandewoning").checked == true) { subtotaal = subtotaal + 170; } toeslagcontant = 5; } if (document.getElementById("gk").checked == true) { subtotaal = subtotaal + 130; toeslagcontant = 5; } if (document.getElementById("ek").checked == true &amp;&amp; document.getElementById("epc").checked == true) { if (document.getElementById("studio").checked == true) { combikorting = 0; } else if (document.getElementById("appartement").checked == true) { combikorting = 10; } else if (document.getElementById("rijwoning").checked == true) { combikorting = 15; } else if (document.getElementById("halfopenwoning").checked == true) { combikorting = 15; } else if (document.getElementById("vrijstaandewoning").checked == true) { combikorting = 10; } } totaal = subtotaal - combikorting document.getElementById("totaal").innerHTML = totaal + " EUR"; if (document.getElementById("terplaatse").checked == true) { totaaltebetalen = totaal + toeslagcontant; } else { totaaltebetalen = totaal; } document.getElementById("totaaltebetalen").innerHTML = totaaltebetalen + " EUR"; } HTML: &lt;h2&gt;Total à payer:&lt;/h2&gt;&lt;br /&gt; &lt;table cellpadding="0" cellspacing="0" border="0" style="width:270px;"&gt; &lt;tr style="height:25px"&gt; &lt;td&gt;&amp;nbsp;&lt;/td&gt; &lt;td&gt;&lt;strong class="pricetext"&gt;&lt;div id="totaaltebetalen"&gt;0 EUR&lt;/div&gt;&lt;/strong&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; </code></pre> <p>i would like to insert the "totaaltebetalen" (price) into my database. How can i store this into a variable so that i can do an "INSERT INTO" with all my other variables on the same time. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload