-- 作者:lshshlxsh
-- 发布时间:2017/9/19 9:03:00
-- 下拉隐藏
Dim e As RequestEventArgs = args(0) Dim wb As New weui Select Case e.Path Case "aa.htm"
wb.AddForm("","form1","handle.htm") \'指定接收表单数据的的页面为handle.htm With wb.AddInputGroup("form1","ipg1","aa" ) .AddSelect("对象","对象", "黄色|红色").Attribute = "showandhide(this.value)" \'调用js函数。
With wb.AddRadioGroup("form1","颜色","颜色") .Add("淡黄","淡黄") .Add("金黄","金黄")
.Add("粉红","粉红") .Add("朱红","朱红")
End With End With
wb.AppendHTML("<script src=\'./lib/brands.js\'></script>") \'引入脚本文件
e.WriteString(wb.Build)
End Select
请问一下我选择黄色之后 怎么把粉红 和朱红隐藏 ,选择红色后只显示 粉红 和朱红?
下面这段放在foxtable网页要怎么写?
[此贴子已经被作者于2017/9/19 15:43:43编辑过]
|
-- 作者:有点甜
-- 发布时间:2017/9/19 10:05:00
--
Case "test.htm" Dim wb As new weui wb.AddForm("","form1","handle.htm") \'指定接收表单数据的的页面为handle.htm With wb.AddInputGroup("form1","ipg1","aa" ) .AddSelect("对象","对象", "黄色|红色").Attribute = "onchange=""if(this.value==\'红色\') {var r1 = document.querySelector(\'label[for=\\\'淡黄\\\']\');r1.style.display=\'none\';var r2 = document.querySelector(\'label[for=\\\'金黄\\\']\');r2.style.display=\'none\';var r3 = document.querySelector(\'label[for=\\\'粉红\\\']\');r3.style.display=\'flex\';var r4 = document.querySelector(\'label[for=\\\'朱红\\\']\');r4.style.display=\'flex\';} else {var r1 = document.querySelector(\'label[for=\\\'淡黄\\\']\');r1.style.display=\'flex\';var r2 = document.querySelector(\'label[for=\\\'金黄\\\']\');r2.style.display=\'flex\';var r3 = document.querySelector(\'label[for=\\\'粉红\\\']\');r3.style.display=\'none\';var r4 = document.querySelector(\'label[for=\\\'朱红\\\']\');r4.style.display=\'none\';}""" \'调用js函数. With wb.AddRadioGroup("form1","颜色","颜色")
.Add("淡黄","淡黄") .Add("金黄","金黄") .Add("粉红","粉红") .Add("朱红","朱红") End With End With wb.AppendHTML("<style>label[for=""粉红""]{display:none}</style>") wb.AppendHTML("<style>label[For=""朱红""]{display:none}</style>") e.WriteString(wb.Build)
|
-- 作者:有点甜
-- 发布时间:2017/9/19 15:28:00
--
我这样测试没问题
Case "test.htm" Dim wb As new weui wb.AddForm("","form1","handle.htm") \'指定接收表单数据的的页面为handle.htm With wb.AddInputGroup("form1","ipg1","aa" ) .AddSelect("对象","对象", "黄色|红色").Attribute = "onchange=""if(this.value==\'红色\') {var r1 = document.querySelector(\'label[for=\\\'淡黄\\\']\');r1.style.display=\'none\';var r2 = document.querySelector(\'label[for=\\\'金黄\\\']\');r2.style.display=\'none\';var r3 = document.querySelector(\'label[for=\\\'粉红\\\']\');r3.style.display=\'flex\';var r4 = document.querySelector(\'label[for=\\\'朱红\\\']\');r4.style.display=\'flex\';} else {var r1 = document.querySelector(\'label[for=\\\'淡黄\\\']\');r1.style.display=\'flex\';var r2 = document.querySelector(\'label[for=\\\'金黄\\\']\');r2.style.display=\'flex\';var r3 = document.querySelector(\'label[for=\\\'粉红\\\']\');r3.style.display=\'none\';var r4 = document.querySelector(\'label[for=\\\'朱红\\\']\');r4.style.display=\'none\';}""" \'调用js函数. End With With wb.AddInputGroup("form1","ipg2","bb" ) .AddSelect("aa","aa", "a|b").Attribute = "onchange=""if(this.value==\'a\') {var r1 = document.querySelector(\'label[for=\\\'b\\\']\');r1.style.display=\'none\';var r2 = document.querySelector(\'label[for=\\\'a\\\']\');r2.style.display=\'flex\'} else {var r1 = document.querySelector(\'label[for=\\\'b\\\']\');r1.style.display=\'flex\';var r2 = document.querySelector(\'label[for=\\\'a\\\']\');r2.style.display=\'none\'}""" \'调用js函数. End With With wb.AddRadioGroup("form1","颜色","颜色") .Add("淡黄","淡黄") .Add("金黄","金黄") .Add("粉红","粉红") .Add("朱红","朱红") End With With wb.AddRadioGroup("form1","bb","bb") .Add("b","b") .Add("a","a") End With wb.AppendHTML("<style>label[for=""粉红""]{display:none}</style>") wb.AppendHTML("<style>label[For=""朱红""]{display:none}</style>") e.WriteString(wb.Build)
[此贴子已经被作者于2017/9/19 15:28:41编辑过]
|