说明:我是在原能执行代码基础上,修改的,加了AddTabBar,为下面各控件加了bt3,发现js文件的alert("OK");不显示
下面是页面per_quyu.htm的代码:
Dim e As RequestEventArgs = args(0) '注册第4页,区域信息
Dim wb As New weui
With wb.AddTabBar("", "tb1",0) '使用TabBar,增加4个按钮(注:页面可以增加,但不考虑)
.AddButton("bt1","首页","./images/a.png","/index.htm")
.AddButton("bt2","设置","./images/b.png","/per_chakanshezhi.htm")
.Addpage("bt3","当前","./images/c.png")
.AddButton("bt4","我的","./images/d.png","/personal.htm")
'.Attribute = "style='height:55px'"
End With
wb.AddTopTips("bt3","toptip1","") '用于显示动态错误提示
With wb.AddArticle("bt3","ar1")
.AddImage("./images/langwo/logo1.jpg")
.Attribute = "style='padding:0em;'"
End With
wb.AddForm("bt3","form1","per_quyu.htm").Attri-bute="on-submit='return validit_per_quyu()'"
With wb.AddInputGroup("bt3","ipg1","所在区域")
With .AddSelect("szs","所在省","|" & DataTables("城市列表").sqlGetComboListString("所在省"))
.Attribute = "on-change=""setAjaxOptions('szshi','p_quyu_get.htm','szs',false)""" ’这里取值正常
End With
With .AddSelect("szshi","所在市","")
.Attribute = "on-change=""setAjaxOptions('szqx','p_quyu_get.htm','szs','szshi',false)""" ’这里取值正常
End With
.AddSelect("szqx","所在区县","")
End With
With wb.AddInputGroup("bt3","ipg2","家乡区域")
With .AddSelect("jxs","家乡省","|" & DataTables("城市列表").sqlGetComboListString("所在省"))
.Attribute = "on-change=""setAjaxOptions('jxshi','p_quyu_get.htm','jxs',false)""" ’这里取值正常
End With
With .AddSelect("jxshi","家乡市","")
.Attribute = "on-change=""setAjaxOptions('jxqx','p_quyu_get.htm','jxs','jxshi',false)""" ’这里取值正常
End With
.AddSelect("jxqx","家乡区县","")
With wb.AddButtonGroup("bt3","btg2",True)
.Add("btn1", "确定","submit")
End With
End With
wb.AppendHTML("<script s-rc='./lib/ajaxform_per_quyu.js'></script>") '引入脚本文件
e.WriteString(wb.Build) '生成网页
下面是js代码:(js的文件的路径是对的,文件名是:ajaxform_per_quyu.js)
function validit_per_quyu(){
alert("OK"); ’执行上述代码,这个ok不显示
var result=submitAjaxFileds("p_per_quyu.htm","","szs","szshi","szqx","jxs","jxshi","jxqx",false);
if(result=="OK"){
return true;
}
else{
showTopTips("toptip1",result,2000);
return false;
}
}
[此贴子已经被作者于2017/5/1 21:09:46编辑过]