老师们,请帮忙解决下面问题:
本人对移动开发范例“一个录入界面”(http://www.foxtable.com/mobilehelp/scr/0059.htm)进行测试时,用360浏览器和华为手机的华为浏览器访问均正常。之后,结合工作实际对代码进行修改(代码如下)并对另一个数据表进行操作,在360浏览器中显示正常 ,但用手机华为浏览器(IP:192.168.0.100/addnew.htm)进行访问时,发现在点击“出生日期”一栏输入后,不会自动弹出手机专用日期输入辅助窗口,而是通用输入窗口,即使用输入日期后,在提交时出现“出生日期列不能为空”的提示。不知怎么回事?
Dim fl As String = "d:\web\" & e.path
If filesys.FileExists(fl)
Dim idx As Integer = fl.LastIndexOf(".")
Dim ext As String = fl.SubString(idx)
Select Case ext
Case ".jpg",".gif",".png",".bmp",".wmf",".js",".css" ,".html",".htm",".zip",".rar"
e.WriteFile(fl)
Return '这里必须返回
End Select
End If
Dim wb As New weui
Select Case e.Path
Case "addnew.htm"
If e.PostValues.Count = 0 Then
wb.AddForm("","form1","addnew.htm")
With wb.AddInputGroup("form1","ipg1","客户资料")
.AddInput("姓名","姓名","Text") '前一个"姓名"是ID,后一个"姓名"是标题
.AddInput("部门","部门","Text")
.AddInput("出生日期","出生日期","Date")
.AddSelect("性别","性别","男|女")
.AddSwitch("在职","在职").Value = "True"
End With
With wb.AddRadioGroup("form1","尊称","尊称")
.Add("男士","男士")
.Add("女士","女士")
.Add("博士","博士")
End With
With wb.AddCheckGroup("form1","偏好","品牌偏好")
.Add("苹果","苹果")
.Add("华为","华为")
.Add("三星","三星")
End With
With wb.AddButtonGroup("form1","btg1",True)
.Add("btn1", "确定", "submit")
End With
e.WriteString(wb.Build)
Else
Dim nms() As String = {"姓名","部门","出生日期","性别"} '不能为空的列名数组
For Each nm As String In nms
If e.PostValues.ContainsKey(nm) = False Then '生成错误提示页
With wb.AddMsgPage("","msgpage","增加失败", nm & "列不能为空!")
.icon = "Warn" '改变图标
.AddButton("btn1","返回").Attribute = ""
End With
e.WriteString(wb.Build)
Return '必须返回
End If
Next
nms = New String() {"姓名","部门","出生日期","性别","在职","尊称","偏好"} '重新定义了nms数组,增加了两列.
Dim dr As DataRow = DataTables("单位员工").AddNew()
For Each nm As String In nms
If e.PostValues.ContainsKey(nm) Then
dr(nm) = e.PostValues(nm)
End If
Next
'以下代码处理品牌复选列表项
Dim pp As String
nms = New String() {"苹果","华为","三星"} '将nms重新定义为品牌数组
For Each nm As String In nms
If e.PostValues.ContainsKey(nm) AndAlso e.PostValues(nm).Trim() = "on" Then '不能省略Trim
pp = pp & nm & ","
End If
Next
If pp > "" Then
dr("偏好") = pp.Trim(",")
End If
'保存并生成增加成功提示页面
dr.save()
With wb.AddMsgPage("","msgpage","增加成功", "好好学习,天天向上") '生成成功提示页
.AddButton("btn1","继续增加","addnew.htm")
End With
e.WriteString(wb.Build)
End If
End Select