我这样测试没问题
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编辑过]