我在表单上运行了自动计算,并且总数通过div ID显示。我需要能够以某种方式将div ID答案呈现为php形式的邮件程序。
我尝试添加一个带有div ID的隐藏输入字段。
<div id="totalPriceTM">
<input name="Score" id="totalPriceTM" value="" type="hidden" />
</div>
没有错误消息,但结果未显示在电子邮件中。
答案 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的值