With ExWeUI.WebUI.AddTabsGroup("page1", "dianzu")
' .Attribute = ""
For Each drdz As DataRow In drdzs '遍历店铺生成tabs,并插入明细表
x = x + 1
diandm = drdz("yhdm")
dianmc = drdz("yhmc")
Dim sb As New StringBuilder
sb.AppendLine("<form action='shuruy_mxbiaoy.htm?diandm=" & diandm & "' enctype='multipart/form-data' method='post' id='" & diandm & "form1'>")
sb.AppendLine("<input id='" & diandm & "diandm' class='yincang' value='" & diandm & "'>")
sb.AppendLine("<input id='" & diandm & "dianmc' class='yincang' value='" & dianmc & "'>")
sb.AppendLine("<input id='" & diandm & "yhlx' class='yincang' value='" & yhlx & "'>")
sb.AppendLine("<input id='" & diandm & "xh' class='yincang' value='" & xh & "'>")
sb.AppendLine("<input id='" & diandm & "spdm' class='yincang' value='" & spdm & "'>")
sb.AppendLine("<input id='" & diandm & "lsj' class='yincang' value='" & lsj & "'>")
sb.AppendLine("<input id='" & diandm & "tijiao' class='yincang' value='" & tijiao & "'>")
sb.AppendLine("</form>")
sb.AppendLine("<script>document.getElementById('dianzu" & diandm & "').addEventListener('click',test2());</script>") '添加监听事件
wb.InsertHTML(sb.ToString)
With .AddPage("dianzu" & diandm, dianmc)
' wb.InsertHTML("page1", "<div id='d1' style='margin:0.5em'></div>") '插入一个div,用于显示服务器返回的明细表格数据
.C & diandm & "' style='margin:0.5em'>" & dianmc & Date.Now & "</div>" '插入一个div,用于显示服务器返回的明细表格数据
End With
Next
wb.InsertHTML(.BuildHtml)
End With
求助,,,以上代码中添加的监听事件不生效(js已添加到head中),,还有form 传递到服务器,服务器只能获取getvalues的值,postvalues中没有值
Dim yhdm As String = e.GetValues("diandm") '用户代码 ‘能正常获取
For Each a As String In e.PostValues.Keys ‘没有值
MessageBox.Show(a & ":" & e.PostValues(a))
Next
[此贴子已经被作者于2024/7/28 9:22:22编辑过]