別のスクリプトを追加するまで、うまく動作するスクリプトがあります。他のスクリプトが追加されると、私はコンソールエラーを受け取ります。ヌル競合の 'on'プロパティを読み取れません
Uncaught TypeError: Cannot read property 'on' of null at mapForm
私は自分のスクリプトをJotFormに統合しているので、いくつかのライブラリがロードされています。私は運がなければ争いを起こそうとしなかった。
https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js
function mapForm() {
var JotFirst = document.getElementById("first_4"),
ACFirst = document.getElementById("firstname");
JotFirst.addEventListener('input', function() {
ACFirst.value = JotFirst.value;
});
var JotLast = document.getElementById("last_4"),
ACLast = document.getElementById("lastname");
JotLast.addEventListener('input', function() {
ACLast.value = JotLast.value;
});
JotProd = $("input[type='checkbox'][id='input_5_1000']");
ACProd = $("input[type='checkbox'][id='extra_mf_1_515']");
JotProd.on("change", function() {
ACProd.prop("checked", this.checked);
});
$("#input_5_custom_1000_0").change(function() {
var el = $(this) ;
if(el.val() === "Option Two") {
document.getElementById("extra_mf_3_516").selectedIndex = "1";
}
else if(el.val() === "Option Three") {
document.getElementById("extra_mf_3_516").selectedIndex = "2";
}
});
}
window.onload = mapForm;
上記のコードは、独自のコードで正常に動作します。
https://cdn.jotfor.ms/static/prototype.forms.js https://cdn.jotfor.ms/static/jotform.forms.js
これらが導入されると、スクリプトが機能しなくなります。私は検索して検索し、解決するために知っているすべてを試しました。
はここで問題のページです:https://btwebnetwork.com/scripts/multi-submission-form/AllClients.php
ようにそれを行うことができますを指摘いただきありがとうございます。私は怠け者になった。今朝急いで。必要に応じてさらに編集します。本当にこれを理解することを望んでいます。 – jarmerson
'JotProd'変数を設定した後に' console.log'すれば、何が見えますか? – ValLeNain
Uncaught TypeError:window.onload(AllClients.php:72) – jarmerson