以文本方式查看主题 - 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写的移动端页面如下: 狐表中关键代码如下: 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)
|