表格自动计算PHP答案

时间:2019-08-05 21:33:30

标签: php html

我在表单上运行了自动计算,并且总数通过div ID显示。我需要能够以某种方式将div ID答案呈现为php形式的邮件程序。

我尝试添加一个带有div ID的隐藏输入字段。

            <div id="totalPriceTM">
            <input name="Score"  id="totalPriceTM" value=""   type="hidden" />
            </div>

没有错误消息,但结果未显示在电子邮件中。

1 个答案:

答案 0 :(得分:-1)

您应该在表单上创建不同的div名称。 例如:

<script>
function autocalc(x,y)
{
   a = x*y;
   document.getElementById(totalPriceTM).innerHTML  = a;
   document.getElementById(totalPriceTM2).value = a;
}
</script>

<div id="totalPriceTM">
<input name="Score"  id="totalPriceTM2" value=""   type="hidden" />
</div>

结果将显示在div totalPriceTM上,并将设置为div totalPriceTM2的值

相关问题