I would like to assign value of product of two integer numbers into a hidden field already in the html document.(我想将两个整数的乘积值分配给html文档中已有的隐藏字段。)
I was thinking about getting the value of a javascript variable and then passing it on a input type hidden.(我正在考虑获取javascript变量的值,然后将其传递给隐藏的输入类型。) I'm having a hard time to explain but this is how it should work:(我很难解释,但这是它应该如何工作:)
Script Example(脚本示例)
<script type="text/javascript">
function product(a,b){
return a*b;
}
</script>
above computes the product and i want the product to be in hidden field.(以上计算产品,我希望产品在隐藏领域。)
<input type="hidden" value="[return value from product function]">
How is this possible?(这怎么可能?)
ask by KaHeL translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…