Send value with submit from output element

不想你离开。 提交于 2019-12-13 07:21:45

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!