如果是后台判断,可以在接收后,获取勾选的选项判断。
如果是前端判断,需要绑定事件使用js,类似:http://www.foxtable.com/mobilehelp/topics/0083.htm
比如:Select Case e.Path
Case "test.htm"
Dim wb As New weui
If e.PostValues.Count = 0 Then
wb.AddTopTips("", "toptip1", "不能超过2个!")
wb.AddForm("", "form1", "test.htm").Attribute = ""
With wb.AddCheckGroup("form1", "rdg1", "浏览器")
.Add("bw1", "Intenet Explorer", True) '默认勾选
.Add("bw2", "Google Chorme")
.Add("bw3", "FireFox")
.Add("bw4", "Safari") '此项不可选
End With
With wb.AddButtonGroup("form1", "btg1", True)
.Add("btn1", "确定", "submit")
End With
wb.AppendHTML("<script>function valid(){var v1 = document.getElementById(""bw1"").checked?1:0;var v2 = document.getElementById(""bw2"").checked?1:0;var v3 = document.getElementById(""bw3"").checked?1:0;if (v1 + v2 + v3 <= 2){return true};show(""toptip1"",2000);return false;}</script>")
e.WriteString(wb.Build) '生成网页
Else
Dim sb As New StringBuilder
sb.AppendLine("<meta name='viewport' c>")
For Each key As String In e.PostValues.Keys
sb.AppendLine(key & ":" & e.PostValues(key) & "</br>")
Next
e.WriteString(sb.ToString)
End If
End Select