When loading the Dashboard, I just got the following error message from “code.js”
Uncaught TypeError: Cannot read property ‘substr’ of undefined.
line 445 column 58
The console additionally says:
Uncaught TypeError: Cannot read property ‘substr’ of undefined
at HTMLDivElement.inpSubdomain.onchange (code.js:445)
The code section looks as follows:
inpSubdomain.onchange = function() {
var OK = true;
var s = inpSubdomain.value;
if (s == "") OK = false;
>>> if ("0123456789abcdefghijklmnopqrstuvwxyz".indexOf(s.substr(0, 1)) == -1) OK = false;
for (i = 1; i < s.length; i++) {
if ("0123456789-abcdefghijklmnopqrstuvwxyz".indexOf(s.substr(i, 1)) == -1) OK = false;
}
if (!OK) {
$("#inpSubdomain .help-block").removeClass("hidden");
$("#inpSubdomain").addClass("has-error");
} else {
$("#inpSubdomain .help-block").addClass("hidden");
$("#inpSubdomain").removeClass("has-error");
}
if (s.length > 63) OK = false;
return OK;
}
The faulty line has been marked with “>>>”
Perhaps, this may be useful for you.