以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]AddInputGroup输入框标题能不能修改  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=179050)

--  作者:ajie5211
--  发布时间:2022/8/4 15:19:00
--  [求助]AddInputGroup输入框标题能不能修改

Select Case e.Path
    Case "test.htm"
        Dim wb As New weui
        wb.AddForm("","form1","test.htm")
        With wb.AddInputGroup("form1","ipg1","登录")
            .AddInput("xm","户名","text")
            .AddInput("pw","密码","password")
        End With
        With wb.AddButtonGroup("form1","btg1",True)
            .Add("btn1", "确定", "submit")
        End With
        e.WriteString(wb.Build)
\'生成网页

End
Select

在页面里看,这里的AddInputGroup分组没有ID,造成想通过JS换标题一直换不了,这个分组能加ID么?


--  作者:有点蓝
--  发布时间:2022/8/4 16:12:00
--  
通过JS获取ipg1元素,再根据ipg1元素获取其上边兄弟元素即可
[此贴子已经被作者于2022/8/4 16:15:22编辑过]

--  作者:ajie5211
--  发布时间:2022/8/4 16:14:00
--  

你说的是哪个元素,没找到啊!

 只看到ID和name是空!

<!DOCTYPE html>
<html lang=\'zh-cmn-Hans\'>
<head>
<meta charset=\'utf-8\'>
<meta name=\'viewport\' c>
<link rel=\'stylesheet\' href=\'/weui/weui.min.css\'/>
<link rel=\'stylesheet\' href=\'/weui/weui.me.css\'/>
<link rel=\'icon\' href=\'data: ;base64,=\'>
<title></title>
<script src=\'/weui/weui.me.js\'></script>
</head>
<body onload()\'>
<form method=\'post\' enctype=\'multipart/form-data\' id=\'form1\' name =\'form1\' action =\'cs.htm\'>
<div class=\'fox_group\'>
<div id=\'\' name=\'\' class=\'weui_cells_title\'>登录</div>
<div class=\'weui_cells weui_cells_form\' id=\'ipg1\' name=\'ipg1\'>
<div class=\'weui_cell\'>
<div class=\'weui_cell_hd\'><label class=\'weui_label\'>户名</label></div>
<div class=\'weui_cell_bd weui_cell_primary\'>
<input id=\'xm\' name=\'xm\' type=\'text\' class=\'weui_input\'/>
</div>
</div>
<div class=\'weui_cell\'>
<div class=\'weui_cell_hd\'><label class=\'weui_label\'>密码</label></div>
<div class=\'weui_cell_bd weui_cell_primary\'>
<input id=\'pw\' name=\'pw\' type=\'password\' class=\'weui_input\'/>
</div>
</div>
</div>
</div>
<div class=\'fox_v_button_group\'>
<div class = \'fox_v_button\'>
<button id=\'btn1\' name=\'btn1\' type=\'submit\' class=\'weui_btn weui_btn_primary\'>确定</button>
</div>
</div>
</form>
</body>
</html>

[此贴子已经被作者于2022/8/4 16:15:17编辑过]

--  作者:有点蓝
--  发布时间:2022/8/4 16:16:00
--  
document.getElementById("ipg1").previousElementSibling.innerText = "123"