Possible Duplicate:
JavaScript post request like a form submit
I have a value calculated in JS that I’d like to pass as part of an input form to a PHP script. How can I get a value the JS value to the PHP as a POST parameter?
Basically, on submit, I need the total var to be passed via post to the next script.
The first idea that comes to mind is create an invisible input form that has the value in it and is inputted with the form, is that possible?
Yes you could use an
<input type="hidden" />and set the value of that hidden field in your javascript code so it gets posted with your other form data.