以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 怎么实现页面单选被选择后,显示指定的内容,反之就隐藏。 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=168773) |
-- 作者:cnsjroom -- 发布时间:2021/5/23 2:21:00 -- 怎么实现页面单选被选择后,显示指定的内容,反之就隐藏。 怎么实现页面单选被选择后,显示指定的内容,反之就隐藏。 想实现效果: 1、将举报人 联系电话 验证码 三栏 显示在 是否实名举报栏之后。 2、页面单选框 怎么实现选择实名举报后 弹出举报人输入栏 同理,实现选择申请奖励后 弹出申请奖励须知 当前效果: Dim e As RequestEventArgs = args(0) Dim wb As New weui wb.Title = "test" wb.AddForm("","form1","valid.htm").Attribute="" With wb.AddArticle("form1","ar1") .AddImage("./images/2.jpg") With wb.AddInputGroup("form1","ipg212","") With .AddInput("举报类型","举报类型","text") .Placeholder = "请准确输入线索描述……" .Readonly=True .Value="环境污染" End With .AddInput("线索地点","线索地点","text").PlaceHolder = "请输入准确的地址" .AddInput("位置描述","位置描述*","text").PlaceHolder = "请输入地址辅助性说明" End With With wb.AddInputGroup("form1","ipg22","线索描述") With .AddTextArea("bz",5) .Placeholder = "请准确输入线索描述……" End With End With With wb.AddInputGroup("form1","ipg2","图片或视频上传") \'文件上传 With.AddUploader("up1","",True) \'True表示允许上传多个文件 .AllowDelete = True \'允许删除 .Incremental = True \'允许重复选择文件或连续拍照 .ScaleWidth = 1024 End With Dim sb As New StringBuilder sb.appendLine("<div>") sb.appendLine("单文件上传: <input type=\'file\' name=\'up1\' id=\'up1\'><br/>") sb.appendLine("多文件上传: <input type=\'file\' name=\'up2\' id=\'up2\' multiple>") sb.appendLine("</div>") wb.InsertHTML("form1",sb.ToString) End With With wb.AddInputGroup("form1","ipg1","") With .AddInputCell("ic3") \'通过InputCell增加输入框 .AddLabel("ljbr","举报人",0) \'增加标签,0显示在左边 .AddInput("jbr","text",1).PlaceHolder = "请输入真实姓名" \'增加输入框,1表示显示在中间 End With With .AddInputCell("ic4") \'通过InputCell增加输入框 .AddLabel("lsj","联系电话",0) \'增加标签,0显示在左边 .AddInput("sjh","text",1).PlaceHolder = "请输入联系电话" \'增加输入框,1表示显示在中间 .AddVcodeButton("vyz","获取验证码",2).Attribute="" End With With .AddInputCell("ic5") \'通过InputCell增加输入框 .AddLabel("lyzm","验证码",0) \'增加标签,0显示在左边 .AddInput("yzm","text",1).PlaceHolder = "请输入短信中的验证码" \'增加输入框,1表示显示在中间 End With Dim rdg As ExWeUI.ExRadioGroup = ExWeUI.WebUI.AddRadioGroup("","rdg1","是否实名举报</span>") rdg.add("rd1","实名举报") rdg.add("rd2","匿名举报",True).enabled = True wb.InsertHTML("form1",rdg.BuildHtml) Dim rdg1 As ExWeUI.ExRadioGroup = ExWeUI.WebUI.AddRadioGroup("","rdg2","是否申请奖励</span>") rdg1.add("rd11","申请奖励") rdg1.add("rd21","不申请奖励",True).enabled = True wb.InsertHTML("form1",rdg1.BuildHtml) Dim bt As String ="根据《奖励办法(试行)》对符合条件的线索进行奖励,点击获取《奖励办法(试行)》详情.注:领取奖励需要实名" With wb.AddInputGroup("form1","ipg222","申请奖励须知") With .AddTextArea("bz1",3) .Readonly=True .Value= bt End With End With With wb.AddButtonGroup("form1","btg1",True) .Add("btn1", "确定", "submit") End With End With End With wb.AppendHTML("<script>" & vars("yanzhengma") & "</script>") \'引入脚本文件 e.WriteString(wb.Build) \'生成网页 |
-- 作者:chnfo -- 发布时间:2021/5/23 10:22:00 -- 控件有一个Visible属性。 Forms("窗口1").Controls("需要显示的控件").visible = Forms("窗口1").Controls("RadioButton1").checked
|
-- 作者:cnsjroom -- 发布时间:2021/5/23 11:20:00 -- 回复:(chnfo)控件有一个Visible属性。Forms("窗口1... 谢谢 学习了 楼上方法在窗体中可用 怎么在移动开发时使用呢?
|
-- 作者:有点蓝 -- 发布时间:2021/5/23 21:15:00 -- 参考:http://www.foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=106788&replyID=&skin=1 |
-- 作者:cnsjroom -- 发布时间:2021/5/23 22:39:00 -- 回复:(有点蓝)参考:http://www.foxtable.com/bbs/... 实名举报被选择时,显示举报人输入框 老师页面代码如下: Dim rdg As ExWeUI.ExRadioGroup = ExWeUI.WebUI.AddRadioGroup("","rdg1","是否实名举报</span>") rdg.add("rd1","实名举报").Attri bute = "oncha nge=\'jubaoxianshi()\'" rdg.add("rd2","匿名举报",True).enabled = True wb.InsertHTML("form1",rdg.BuildHtml) With .AddInputCell("ic3") \'通过InputCell增加输入框 .AddLabel("ljbr","举报人",0) \'增加标签,0显示在左边 .AddInput("jbr","text",1).PlaceHolder = "请输入真实姓名" \'增加输入框,1表示显示在中间 End With js代码是这样写么? function jubaoxianshi(){ var gj=document.getElementById("rd1").value; if(gj==true) { document.getElementById("ic3").parentNode.style.display="inline"; document.getElementById("ic3").parentNode.style.display="block"; } } 运行没有达到效果 [此贴子已经被作者于2021/5/23 23:08:18编辑过]
|
-- 作者:有点蓝 -- 发布时间:2021/5/23 23:07:00 -- https://www.runoob.com/jsref/prop-style-display.html Select Case e.Path Case "test.htm" Dim wb As New WeUI wb.Title = "test" wb.AddForm("","form1","valid.htm") Dim rdg As ExWeUI.ExRadioGroup = ExWeUI.WebUI.AddRadioGroup("","rdg1","是否实名举报") rdg.add("rd1","实名举报") rdg.add("rd2","匿名举报",True).enabled = True wb.InsertHTML("form1",rdg.BuildHtml) With wb.AddInputGroup("form1","ipg1","") With .AddInputCell("ic3") \'通过InputCell增加输入框 .AddLabel("ljbr","举报人",0) \'增加标签,0显示在左边 .AddInput("jbr","text",1).PlaceHolder = "请输入真实姓名" \'增加输入框,1表示显示在中间 End With With .AddInputCell("ic4") \'通过InputCell增加输入框 .AddLabel("lsj","联系电话",0) \'增加标签,0显示在左边 .AddInput("sjh","text",1).PlaceHolder = "请输入联系电话" \'增加输入框,1表示显示在中间 .AddVcodeButton("vyz","获取验证码",2).Attribute="" End With With .AddInputCell("ic5") \'通过InputCell增加输入框 .AddLabel("lyzm","验证码",0) \'增加标签,0显示在左边 .AddInput("yzm","text",1).PlaceHolder = "请输入短信中的验证码" \'增加输入框,1表示显示在中间 End With End With Dim rdg1 As ExWeUI.ExRadioGroup = ExWeUI.WebUI.AddRadioGroup("","rdg2","是否申请奖励") rdg1.add("rd11","申请奖励") rdg1.add("rd21","不申请奖励",True).enabled = True wb.InsertHTML("form1",rdg1.BuildHtml) Dim bt As String ="根据《奖励办法(试行)》对符合条件的线索进行奖励,点击获取《奖励办法(试行)》详情.注:领取奖励需要实名" With wb.AddInputGroup("form1","ipg222","申请奖励须知") With .AddTextArea("bz1",3) .Readonly=True .Value= bt End With End With With wb.AddButtonGroup("form1","btg1",True) .Add("btn1", "确定", "submit") End With e.WriteString(wb.Build) \'生成网页 End Select |
-- 作者:cnsjroom -- 发布时间:2021/5/23 23:48:00 -- 回复:(有点蓝)https://www.runoob.com/jsref/prop-... 当前运行效果如下: 1、页面默认打开时选择匿名举报 不申请奖励 当选择了实名举报或者申请奖励之后 ,如果再选择匿名举报或者不申请奖励的时候 对应的内容没有发生隐藏,麻烦老师帮忙看看 谢谢 当前js代码如下: document.getElementById("ic6").parentNode.style.display="inline"; ‘非实名举报显示内容’ document.getElementById("ic6").parentNode.style.display="block"; document.getElementById("ipg222").parentNode.style.display="none"; ‘隐藏申请奖励须知内容’ document.getElementById("ic3").parentNode.style.display="none"; ‘隐藏实名举报内容’ function jubaoxianshi(){ var gj=document.getElementById("rd1").value; ‘选择实名举报’ if(gj==true) { } else{ document.getElementById("ic3").parentNode.style.display="inline"; document.getElementById("ic3").parentNode.style.display="block"; document.getElementById("ic6").parentNode.style.display="none"; } } function jianglixianshi(){ var gj=document.getElementById("rd11").value; ‘选择申请奖励’ if(gj==true) { } else{ document.getElementById("ipg222").parentNode.style.display="inline"; document.getElementById("ipg222").parentNode.style.display="block"; } } test页面代码如下: Dim e As RequestEventArgs = args(0) Dim wb As New weui Dim uuid As String = Guid.NewGuid.TOstring() If e.PostValues.Count = 0 Then wb.Title = "test" wb.AddForm("","form1","valid.htm").Attrib ute="ons ubmit=\'return validit()\'" With wb.AddArticle("form1","ar1") .AddImage("./images/2.jpg") With wb.AddInputGroup("form1","ipg212","") With .AddInput("举报类型","举报类型","text") .Placeholder = "请准确输入线索描述……" .Readonly=True .Value="环境污染" End With .AddInput("线索地点","线索地点","text").PlaceHolder = "请输入准确的地址" .AddInput("位置描述","位置描述*","text").PlaceHolder = "请输入地址辅助性说明" End With With wb.AddInputGroup("form1","ipg22","线索描述") With .AddTextArea("bz",5) .Placeholder = "请准确输入线索描述……" End With End With With wb.AddInputGroup("form1","ipg2","图片或视频上传") \'文件上传 With.AddUploader("up1","",True) \'True表示允许上传多个文件 .AllowDelete = True \'允许删除 .Incremental = True \'允许重复选择文件或连续拍照 .ScaleWidth = 1024 End With End With Dim rdg As ExWeUI.ExRadioGroup = ExWeUI.WebUI.AddRadioGroup("form1","rdg1","是否实名举报</span>") rdg.add("rd1","实名举报").Attribute = "onch ange=\'jubaoxianshi()\'" rdg.add("rd2","匿名举报",True).enabled = True wb.InsertHTML("form1",rdg.BuildHtml) With wb.AddInputGroup("form1","ipg100","") With .AddInputCell("ic3") \'通过InputCell增加输入框 .AddLabel("ljbr","举报人",0) \'增加标签,0显示在左边 .AddInput("jbr","text",1).PlaceHolder = "请输入真实姓名" \'增加输入框,1表示显示在中间 End With With .AddInputCell("ic4") \'通过InputCell增加输入框 .AddLabel("lsj","联系电话",0) \'增加标签,0显示在左边 .AddInput("sjh","text",1).PlaceHolder = "请输入联系电话" \'增加输入框,1表示显示在中间 .AddVcodeButton("vyz","获取验证码",2).At tribute="on click=\'getNum()\'" End With With .AddInputCell("ic5") \'通过InputCell增加输入框 .AddLabel("lyzm","验证码",0) \'增加标签,0显示在左边 .AddInput("yzm","text",1).PlaceHolder = "请输入短信中的验证码" \'增加输入框,1表示显示在中间 End With End With With wb.AddInputGroup("form1","ipg12","") With .AddInputCell("ic6") \'通过InputCell增加输入框 .AddLabel("lsj","联系电话",0) \'增加标签,0显示在左边 .AddInput("sjh","text",1).PlaceHolder = "请输入联系电话" \'增加输入框,1表示显示在中间 .AddVcodeButton("vyz","获取验证码",2).Attr ibute="onc lick=\'getNum()\'" End With With .AddInputCell("ic7") \'通过InputCell增加输入框 .AddLabel("lyzm","验证码",0) \'增加标签,0显示在左边 .AddInput("yzm","text",1).PlaceHolder = "请输入短信中的验证码" \'增加输入框,1表示显示在中间 End With End With Dim rdg1 As ExWeUI.ExRadioGroup = ExWeUI.WebUI.AddRadioGroup("form1","rdg2","是否申请奖励</span>") rdg1.add("rd11","申请奖励").Attrib ute = "onch ange=\'jianglixianshi()\'" rdg1.add("rd21","不申请奖励",True).enabled = True wb.InsertHTML("form1",rdg1.BuildHtml) Dim bt As String ="根据《奖励办法(试行)》对符合条件的线索进行奖励,点击获取《奖励办法(试行)》详情.注:领取奖励需要实名" With wb.AddInputGroup("form1","ipg222","申请奖励须知") With .AddTextArea("bz1",3) .Readonly=True .Value= bt End With End With With wb.AddButtonGroup("form1","btg1",True) .Add("btn1", "确定", "submit") End With End With wb.AppendHTML("<script>" & vars("yanzhengma") & "</script>") \'引入脚本文件 wb.AppendHTML("<script>" & vars("jubao") & "</script>") \'引入脚本文件 e.WriteString(wb.Build) \'生成网页 Else Dim cmd As New SQ LCommand cmd.Connecti cmd.Comma ndText = "Inse rt Into 线索举报 (uuid,举报类型,线索地点,位置描述,线索描述,实名举报,匿名举报,联系人,联系电话,验证码,申请奖励,不申请奖励,举报时间) Values(?,?,?,?,?,?,?,?,?,?,?,?,?)" cmd.Parameters.Add("@uuid", uuid) cmd.Parameters.Add("@举报类型", e.PostValues("举报类型")) cmd.Parameters.Add("@线索地点", e.PostValues("线索地点")) cmd.Parameters.Add("@位置描述", e.PostValues("位置描述")) cmd.Parameters.Add("@线索描述", e.PostValues("线索描述")) cmd.Parameters.Add("@实名举报", e.PostValues("rd1")) cmd.Parameters.Add("@匿名举报", e.PostValues("rd2")) cmd.Parameters.Add("@联系人", e.PostValues("jbr")) cmd.Parameters.Add("@联系电话", e.PostValues("sjh")) cmd.Parameters.Add("@验证码", e.PostValues("yzm")) cmd.Parameters.Add("@申请奖励", e.PostValues("rd11")) cmd.Parameters.Add("@不申请奖励", e.PostValues("rd12")) cmd.Parameters.Add("@举报时间",Date.now) cmd.ExecuteNonQuery e.WriteString("OK") End If 2、运行test页面之后,填写相关数据,并验证了验证码正确的情况下 页面返回到valid 页面 提示OK,当前数据并没有写入数据库中。麻烦老师指导下!怎么实现点击确定之后,当前页面填写的写入数据库表中,并且又返回到test页面。 valid验证验证码代码: Dim e As RequestEventArgs = args(0) Dim sjh As String = e.Values("sjh") Dim yzm As String = e.Values("yzm") If e.Cookies.ContainsKey(sjh) = False Then e.WriteString("请点击发送验证码") Return "" End If If e.Cookies(sjh) <> yzm Then e.WriteString("验证码不正确") Return "" End If e.WriteString("ok") 发送验证码短信代码: Dim e As RequestEventArgs = args(0) Dim yzm As String = Rand.Next(100000, 999999) Dim shoujihao As String = e.PlainText Dim url As String url = "http://service.winic.org:8009/sys_port/gateway/?id=wuzhan588&pwd=wuzhan588&to=" & shoujihao & "&c&time=" Dim hc As New HttpClient(url) Dim result As String = "000000" \'hc.GetData() If result.split("/")(0) = "000000" Then e.AppendCookie(shoujihao, yzm) e.WriteString("当前验证码已经发送至:【" & shoujihao & "】,请查收!如果60秒后没有收到短信请重新获取验证码!") Else e.WriteString("发送失败,稍后重试") End If [此贴子已经被作者于2021/5/24 1:41:30编辑过]
|
-- 作者:有点蓝 -- 发布时间:2021/5/24 8:51:00 -- 1、处理逻辑应该是: 下面是文字说明,自己转换为合适的代码,上面7楼代码只有下面逻辑的一半 if(点击实名举报){ 隐藏控件1 显示控件2 } else{ 显示控件1 隐藏控件2 } 2、 Dim e As RequestEventArgs = args(0) Dim wb As New weui Dim uuid As String = Guid.NewGuid.TOstring() If e.PostValues.Count > 0 Then 保存的代码 cmd.Parameters.Add("@举报时间",Date.now) cmd.ExecuteNonQuery ‘’e.WriteString("OK")去掉这句 end if ‘’不管是否保存都生成表单 wb.Title = "test" wb.AddForm("","form1","test.htm").Attrib ute="ons ubmit=\'return validit()\'" With wb.AddArticle("form1","ar1") …… |