下面的代码, .AddButton("btn1","返回").Attribute = "" 这句,为什么在出现报错页面时,点击“返回”按钮,点一下没有反应仍然停在错误页面,点第二下,不能返回表单继续填,而是返回表单上层的页面?
Dim nms1() As String = {"科室","姓名","岗位","电话","提交日期"} '不能为空的列名数组
For Each nm As String In nms1
If e.PostValues(nm)="" Then '生成错误提示页
' msgbox("测试1")
With wb.AddMsgPage("","msgpage","增加失败", nm & "列不能为空!")
.icon = "Warn" '改变图标
.AddButton("btn1","返回").Attribute = ""
End With
e.WriteString(wb.Build)
Return "wrong" '必须返回
End If
Next
自定义函数satissurvey代码
Dim e As RequestEventArgs = args(0)
Dim wb As New weui
wb.Title="东软服务满意度调查"
wb.AppendHTML("<link rel='stylesheet' href='../ajax/jquery.mobile/1.1.1/jquery.mobile-1.1.1.min.css'/>",True) '引入样式文件,参数True表示添加到head区
wb.AppendHTML("<link rel='stylesheet' href='../xdf/img/main.css'/>",True) '引入样式文伯
wb.AppendHTML("<script src='../ajax/libs/jquery/1.7.1/jquery.min.js'></script>",True) '引入jquery
wb.AppendHTML("<script src='../ajax/jquery.mobile/1.1.1/jquery.mobile-1.1.1.min.js'></script>",True) '引入jquery
wb.AppendHTML("<script src='../scripts/main.js'></script>",True) '引入jquery
wb.InsertHTML("<div data-theme='g' data-role='page' data-position='fixed'>") '页内容样式 不能加</div> 加在好几个地方都不能正常显示页头页脚
'wb.InsertHTML("<h3 align='center' style='margin-top:5px'>服务满意度调查</h3>") '插入表头
If e.PostValues.Count = 0 Then '生成增加调查表网页
wb.AddForm("","form1","SatisSurvey.htm")
' wb.InsertHTML("form1","<fieldset data-role='controlgroup' data-Type='horizontal'>") '起效果了
With wb.AddRadioGroup("form1","q1","应用软件功能是否满足业务需要?")
.Add("a1","是").Value="是" '第一个"是" 是界面输入提示, 第二个"是"是往数据库存的值
.Add("a2","否").Value="否"
End With
With wb.AddRadioGroup("form1","q2","应用软件是否容易操作和使用?")
.Add("b1","是").Value="是"
.Add("b2","否").Value="否"
End With
With wb.AddRadioGroup("form1","q3","应用软件是否容易操作和使用?")
.Add("c1","是").Value="是"
.Add("c2","否").Value="否"
End With
With wb.AddRadioGroup("form1","q4","项目人员是否有效沟通并及时反馈?")
.Add("d1","是").Value="是"
.Add("d2","否").Value="否"
End With
With wb.AddRadioGroup("form1","q5","您对项目人员工作态度是否满意?")
.Add("e1","是").Value="是"
.Add("e2","否").Value="否"
End With
With wb.AddRadioGroup("form1","q6","您对项目人员技术水平是否认可")
.Add("f1","是").Value="是"
.Add("f2","否").Value="否"
End With
With wb.AddRadioGroup("form1","q7","故障响应速度是否及时")
.Add("g1","是").Value="是"
.Add("g2","否").Value="否"
End With
With wb.AddInputGroup("form1","ipg1","您对培训讲师专业知识的评价") 'ipg1 和下面的ipg2 ipg3名称一定不能重,重了就弹不出网页
.AddTextArea("q8",2).Placeholder = "请输入80字以内的备注"
' .AddInput("q8","正文","text") '也可以正常弹出
End With
With wb.AddInputGroup("form1","ipg2","您对培训资料的评价")
.AddTextArea("q9",2).Placeholder = "请输入80字以内的备注"
End With
With wb.AddInputGroup("form1","ipg3","现阶段科室急需解决的问题")
.AddTextArea("q10",3).Placeholder = "请输入120字以内的备注"
End With
'wb.InsertHTML("form1","</fieldset>")
With wb.AddInputGroup("form1","ipg4","您的联系方式")
.AddInput("科室","科室","text")
.AddInput("姓名","姓名","text")
'.AddInput("岗位","岗位","text")
.AddSelect("岗位","岗位","医生|护士|财务人员|工程师|行政人员") '第一个是数据库字段,第二个是 左边的提示
.AddInput("电话","电话","text")
.AddInput("提交日期","提交日期","date")
End With
With wb.AddButtonGroup("form1","btg1",True)
.Add("btn1", "确定", "submit") '.Attribute =""
End With
Else '保存新增的调查单
'以下为验证表单数据是否正常
'msgbox("测试")
Dim nms1() As String = {"科室","姓名","岗位","电话","提交日期"} '不能为空的列名数组
For Each nm As String In nms1
If e.PostValues(nm)="" Then '生成错误提示页
' msgbox("测试1")
With wb.AddMsgPage("","msgpage","增加失败", nm & "列不能为空!")
.icon = "Warn" '改变图标
.AddButton("btn1","返回").Attribute = ""
End With
e.WriteString(wb.Build)
Return "wrong" '必须返回
End If
Next
Dim dr As DataRow = DataTables("满意度调查表").AddNew()
Dim nms() As String = {"q1","q2","q3","q4","q5","q6","q7","q8","q9","q10"}
For Each nm As String In nms
dr(nm) = e.PostValues(nm)
' msgbox(nm & e.PostValues(nm)) ' dr(nm) 为空值
Next
dr.Save()
nms = new String(){"科室","姓名","岗位","电话","提交日期"}
For Each nm As String In nms
dr(nm) = e.PostValues(nm)
' msgbox(nm & e.PostValues(nm)) ' dr(nm) 为空值
Next
dr.Save()
With wb.AddMsgPage("","msgpage","增加成功", "您的意见我们已经收到,感谢你的反馈!") '增加订单成功提示信息
.AddButton("btn1","继续增加","SatisSurvey.htm")
' .AddButton("btn1","返回列表","list.htm")
End With
End If
'wb.AppendHTML("<script src='../ajax/libs/test.js'></script>",True) 'by wk
e.WriteString(wb.Build) '生成网页
[此贴子已经被作者于2017/3/27 13:39:37编辑过]