Use Javascript to return as a php variable
<p>I'm not sure if this is possible since javascript is client side and php is server side, but what I have is a series of javascript functions that give a real time total to orders in a form. To clarify that, as the user selects items in the form it gives a total. On submission of the form php is submitting the order to the database. What I need to achieve is a way to submit the total (created by javascript) of the order to the database (via php obv). The javascript function that creates the total is:</p>

<pre><code>function calculateTotal(){
     var Price = getDropPrice() + getverifyPrice() + getmiscPrice();
     var divobj = document.getElementById('totalPrice');
     divobj.style.display='block';
     divobj.innerHTML = "$"+Price;
}
</code></pre>

<p>The html where this is produced is pretty simple:</p>

<pre><code>&lt;div id="totalPrice"&gt;&lt;/div&gt;
</code></pre>

<p>If you need me to post the other <code>functions(getDropPrice, getverifyPrice, getmiscPrice)</code> let me know, but basically drop is a drop down, verify and misc are radio buttons, I'm just adding their totals together to get the order total in the function above. My searches on SO and google have only shown me how to get php variables into javascript not the other way around so I certainly hope this can be done. Thanks!</p>
