移动端代码:
Dim e As RequestEventArgs = args(0)
Dim wb As WeUI = Args(1)
wb.AddPageTitle("","pageheader","买入信息","")
wb.AddTopTips("","toptip2","")
wb.AddForm("","buyinfo","buysave.html").Attribute=""
If e.GetValues.ContainsKey("m") Then
Dim dr As DataRow= DataTables("资金").Find("用户='" & args(2) & "'")
With wb.AddInputGroup("buyinfo","ipg1","准确记录买入数据")
.AddHidenValue("用户",args(2))
.AddHidenValue("余额",dr("余额")) '经验证余额是>0的;
With .AddInput("名称","名称","text")
.Value = e.GetValues("m")
.Readonly=True
End With
With .AddInput("价格","价格","number")
.Required=True
.Step = "0.01"
End With
With .AddInput("数量","数量","number")
.Required=True
End With
End With
Else
wb.AddTopTips("","toptip1","数据有误!").msec = 2000
End If
With wb.AddButtonGroup("buyinfo","btg1",False)
.Add("btn1", "保存", "submit")
End With
wb.AppendHTML("<script src='./lib/ajaxform.js'></script>") '引入脚本文件
e.WriteString(wb.Build)
Js文件代码:
function Validit(){
alert(1);
alert(document.getElementById("价格").value);
var v1 = document.getElementById("余额").value;
var v2 = document.getElementById("价格").value;
var v3 = document.getElementById("数量").value;
if (v1-v2*V3>0){return true}
showTopTips("toptip2","余额不足!",2500);
return false;
}
执行结果是:JS执行了,弹出了1,后面的弹窗显示价格信息及验证完全没的执行,请教原因?