以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- setAjaxOptions选择空值为卡死 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=101939) |
-- 作者:qwz405 -- 发布时间:2017/6/10 11:08:00 -- setAjaxOptions选择空值为卡死 老师,您好。 开始group是空值,我下拉选择group后,能正常选择name的值;然后再group选择空值时,微信浏览器就卡死了。 这个group值我是可以确定的,但如果不下拉的话,name就没法取到值。 Case "bb.htm" \'首页 ********** With wb.AddInputGroup("form1","ipg1","数据查询") With .AddSelect("group","课室","|" & DataTables("Users").GetComboListString("课室2","部门 = \'业务处\' and 课室2 = \'"& ks2 &"\'","课室2 Desc")) .Attribute = """ End With .AddSelect("name","姓名","") .AddInput("startdate","开始时间","date").Value = Format(Date.Today,"yyyy-MM-dd") .AddInput("enddate","结束时间","date").Value = Format(Date.Today,"yyyy-MM-dd") End With With wb.AddButtonGroup("form1","btg1",True) .Add("btn1", "确定", "submit") End With End If e.WriteString(wb.Build) Case "x10129_keshi.htm" Dim vals As String If e.PostValues.Count = 1 Then vals = "|" & DataTables("users").GetComboListString("姓名","课室2 = \'" & e.PostValues("group") & "\'","姓名") End If e.WriteString(vals) |
-- 作者:有点蓝 -- 发布时间:2017/6/10 11:15:00 -- js代码发上来看看 |
-- 作者:qwz405 -- 发布时间:2017/6/10 11:35:00 -- 判断有没有输入或者选择值。 Case "bb.htm" \'首页 wb.AddTopTips("","toptip1","课室/时间 不能为空!") \'用于显示动态错误提示 wb.AddPageTitle("","ka","数据","***") wb.AddForm("","form1","x10124_Result.htm").Attribute="o n s u b mit = \'return getkeshi()\'" \'使用js脚本文件,判断是否按要求输入数据 ... With wb.AddInputGroup("form1","ipg1","数据查询") With .AddSelect("group","课室","|" & DataTables("Users").GetComboListString("课室2","部门 = \'业务处\' and 课室2 = \'"& ks2 &"\'","课室2 Desc")) .Attribute = """ End With .AddSelect("name","姓名","") .AddInput("startdate","开始时间","date").Value = Format(Date.Today,"yyyy-MM-dd") .AddInput("enddate","结束时间","date").Value = Format(Date.Today,"yyyy-MM-dd") End With With wb.AddButtonGroup("form1","btg1",True) .Add("btn1", "确定", "submit") End With End If e.WriteString(wb.Build) function getkeshi(){ var v1 = document.getElementById("group").value; var v2 = document.getElementById("startdate").value; var v3 = document.getElementById("enddate").value; if (v1 && v2 && v3){return true} show("toptip1",2500); //2500毫秒=2.5秒 return false; }
[此贴子已经被作者于2017/6/10 11:35:52编辑过]
|
-- 作者:有点蓝 -- 发布时间:2017/6/10 11:47:00 -- With .AddSelect("group","课室","|" & DataTables("Users").GetComboListString("课室2","部门 = \'业务处\' and 课室2 = \'"& ks2 &"\'","课室2 Desc")) .Attribute = """这里的代码看不到,用空格隔开发上来看看
|
-- 作者:qwz405 -- 发布时间:2017/6/10 11:51:00 -- With .AddSelect("group","课室",DataTables("Users").GetComboListString("课室2","部门 = \'业务处\'","课室2 Desc")) .Attribute = "o n c h a nge=""setAjaxOptions(\'name\',\'x10129_keshi.htm\',\'group\',false)""" End With
|
-- 作者:有点蓝 -- 发布时间:2017/6/10 12:15:00 -- 命令窗口执行这个代码,看输出什么内容 Output.Show(DataTables("users").GetComboListString("姓名","课室2 = \'\'","姓名"))
|
-- 作者:qwz405 -- 发布时间:2017/6/10 12:52:00 -- 执行结果:什么数据都没有获得。 |
-- 作者:qwz405 -- 发布时间:2017/6/10 13:17:00 -- 老师,通过调试,发现问题出在判断上. 不作判断,就可以正常使用了。 或者加个else,随便弄个不存在的条件,也能正常使用了。
Case "x10129_keshi.htm" Dim vals As String If e.PostValues.Count = 1 Then \'删除 vals = "|" & DataTables("users").GetComboListString("姓名","课室2 = \'" & e.PostValues("group") & "\'","姓名") End If \'删除 e.WriteString(vals) [此贴子已经被作者于2017/6/10 13:37:16编辑过]
|
-- 作者:有点蓝 -- 发布时间:2017/6/10 14:16:00 -- 测试了一下确实有这个问题,e.WriteString的原因,不能写入nothing,否则会网页会停止响应 Case "x10129_keshi.htm" Dim vals As String = "" \'这里赋值为空字符串 If e.PostValues.Count = 1 Then vals = "|" & DataTables("users").GetComboListString("姓名","课室2 = \'" & e.PostValues("group") & "\'","姓名") End If e.WriteString(vals) |
-- 作者:有点蓝 -- 发布时间:2017/6/10 14:16:00 -- 应该是一个bug,已提交 |