问题
I am using the output element in my html to show a oninput calculations i have put in the I workes - but when submitting, only the input values are sent - and not the output value. How do I sent the output value or the oninput value?
<form action='upload.php' nmethod='post' enctype="multipart/form-data" oninput="price.value = (5 * product.value)">
<output type="number" id="totalprice" name="totalprice"></output>
<input id='sendprice' type='submit' value='SEND'>
</form>
回答1:
Add a hidden input field to your form that contains the data like so:
<input type="hidden" name="onInput" value="--Your oninput value--" />
来源:https://stackoverflow.com/questions/40657890/send-value-with-submit-from-output-element