.AddInput("今日进店人数","进店人数","number").Attribute = "onchange='calc()'" '调用js函数,自动计算
.AddInput("今日成交人数","成交人数","number").Attribute = "onchange='calc()'" '调用js函数,自动计算
JS函数
function calc(){
var jd = document.getElementById("进店人数").value
var cj = document.getElementById("成交人数").value
if(jd <> 'undefined' && jd > 0 && cj <> 'undefined'){
document.getElementById("成交率").value = cj / jd;
}
}
[此贴子已经被作者于2018/1/3 8:35:34编辑过]