[英]Automating a form: Form error, Uncaught TypeError: Cannot read property ‘value’ of null
I am trying to automate a form but i get an error.我正在尝试使表单自动化,但出现错误。
Uncaught TypeError: Cannot read property 'value' of null
This is the JS code.这是JS代码。
var elemFound = SingleNodeForXPath( searchTitle );
var result = elemFound.value; #### Uncaught TypeError: Cannot read property 'value' of null ###
return "GOOD:" + result;
})();
This is the end of the js code and error.这是js代码和错误的结尾。
This is the HTML code.这是HTML代码。
<input class="form-control decimal " id="time_card.monday" name="time_card.monday"
maxlength="14" value="" onchange="this.value=formatNumber(this.value);onChange('time_card.monday');" style="; " aria-label="Monday">
Thanks for all the help in advance.感谢您提前提供的所有帮助。
I am using keyboard maestro
to automate it:)我正在使用keyboard maestro
来自动化它:)
This error means that the SingleNodeForXPath( searchTitle );
这个错误意味着SingleNodeForXPath( searchTitle );
function was unable to find the element you are looking for. function 无法找到您要查找的元素。
You can try document.getElementById('time_card.monday')
instead.您可以尝试document.getElementById('time_card.monday')
代替。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.