以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  手机网页报错:Cannot read property 'value' of null  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=170853)

--  作者:benben325
--  发布时间:2021/8/9 16:11:00
--  手机网页报错:Cannot read property 'value' of null
rt,用weui写的移动端页面如下:

图片点击可在新窗口打开查看此主题相关图片如下:qq截图20210809160817.jpg
图片点击可在新窗口打开查看
点击查询可以查询可以显示 查询结果。

狐表中关键代码如下:
With wb.AddInputGroup("page1",Functions.Execute("CreateId"))
    With .AddInputCell("inputBtn") \'通过InputCell增加输入框
        With .AddInput("chaxunIntput","text",1) \'增加输入框,1表示显示在中间
            If filter > "" Then
                .Value = filter
            End If
        End With
        .AddVcodeButton("vcodeBtn","查询",2).Attribute=" & pgname & "\',1)"""
    End With
End With

js代码如下:
function showFilterList(pgname,ye) {
    var vcodeBtn = document.getElementById("vcodeBtn");
var filter = document.getElementById("chaxunIntput").value;
if (!filter){
vcodeBtn.href = "List.htm?page=" + pgname + "&ye=" + ye + "&filter="+filter;
}else{
    vcodeBtn.href = "List.htm?page=" + pgname + "&ye=" + ye;
}
}

点击查询按钮后,控制台出现 :Cannot read property \'value\' of null  
请问我该怎么改?

--  作者:有点蓝
--  发布时间:2021/8/9 16:19:00
--  
if (!filter){

改为

if (filter){

--  作者:benben325
--  发布时间:2021/8/9 16:30:00
--  
这里的确有点问题,但不是关键问题。我将js后面代码注释掉,改为:
function showFilterList(pgname,ye) {
    var vcodeBtn = document.getElementById("vcodeBtn");
    var filter = document.getElementById("chaxunIntput").value;
alert(filter)
}
也会报错!

--  作者:有点蓝
--  发布时间:2021/8/9 16:32:00
--  
var filter = document.getElementById("chaxunintput").value;

增加文本输入框的语法为:

AddInput(ID, Label, type)

ID输入框ID,注意生成网页时,WeUI会自动将所有ID转换为小写,例如"Table1"或转换为"table1",今后不再重复提示,大家请自行留意。
Label在输入框左侧显示的标签内容
Type输入框类型,普通文本输入框设置为"text",密码输入框设置为"password"