我仍然是一個noob在這...我倒了這個代碼片段,無法找到我的錯誤。我知道textarea
REMARKSTEXTAREA
被省略,因爲我不覺得它是相關的。基本上,這是我正在開發的用於創建高端數據電路測試的工具。爲什麼選擇選項後該功能不會觸發?
<!-- BEGIN TEST PATTERNS DROPDOWN MENU -->
<td style="text-align: center; width: 638px;">
<select id="testingdropdownmenu">
<option value="">MAKE A SELECTION</option>
<option value="1">RAN QRSS TEST PATTERN FOR X MINUTES AND TESTING OKAY…</option>
<option value=" RAN QRSS TEST PATTERN FOR 3 MINUTES AND TESTING OKAY… ">RAN QRSS TEST PATTERN FOR 3 MINUTES AND TESTING OKAY…</option>
<option value=" RAN QRSS TEST PATTERN FOR 15 MINUTES AND TESTING OKAY… ">RAN QRSS TEST PATTERN FOR 15 MINUTES AND TESTING OKAY…</option>
<option value=" RAN QRSS TEST PATTERN AND FINDING ERRORS…">RAN QRSS TEST PATTERN AND FINDING ERRORS…</option>
<option value="2">RAN ALL ZEROES TEST PATTERN FOR X SECONDS AND TESTING OKAY…</option>
<option value=" RAN ALL ZEROES TEST PATTERN FOR 30 SECONDS AND TESTING OKAY… ">RAN ALL ZEROES TEST PATTERN FOR 30 SECONDS AND TESTING OKAY…</option>
<option value=" RAN ALL ZEROES TEST PATTERN AND FINDING ERRORS…">RAN ALL ZEROES TEST PATTERN AND FINDING ERRORS…</option>
<option value="3">RAN T-DALY TEST PATTERN FOR X MINUTES AND TESTING OKAY…</option>
<option value=" RAN T-DALY TEST PATTERN AND FINDING ERRORS…">RAN T-DALY TEST PATTERN AND FINDING ERRORS…</option>
<option value="4">RAN 1:8 TEST PATTERN FOR X MINUTES AND TESTING OKAY…</option>
<option value=" RAN 1:8 TEST PATTERN FOR 5 MINUTES AND TESTING OKAY… ">RAN 1:8 TEST PATTERN FOR 5 MINUTES AND TESTING OKAY…</option>
<option value=" RAN 1:8 TEST PATTERN AND FINDING ERRORS…">RAN 1:8 TEST PATTERN AND FINDING ERRORS…</option>
<option value="5">RAN 1:7 TEST PATTERN FOR X MINUTES AND TESTING OKAY…</option>
<option value=" RAN 1:7 TEST PATTERN FOR 5 MINUTES AND TESTING OKAY… ">RAN 1:7 TEST PATTERN FOR 5 MINUTES AND TESTING OKAY…</option>
<option value=" RAN 1:7 TEST PATTERN AND FINDING ERRORS…">RAN 1:7 TEST PATTERN AND FINDING ERRORS…</option>
<option value="6">RAN 2-IN-8 TEST PATTERN FOR X MINUTES AND TESTING OKAY…</option>
<option value=" RAN 2-IN-8 TEST PATTERN AND FINDING ERRORS…">RAN 2-IN-8 TEST PATTERN AND FINDING ERRORS…</option>
<option value="7">RAN BRIDGETAP TEST PATTERN FOR X MINUTES AND TESTING OKAY…</option>
<option value=" RAN BRIDGETAP TEST PATTERN AND FINDING ERRORS…">RAN BRIDGETAP TEST PATTERN AND FINDING ERRORS…</option>
<option value="8">RAN ALL ONES TEST PATTERN FOR X MINUTES AND TESTING OKAY…</option>
<option value=" RAN ALL ONES TEST PATTERN FOR 5 MINUTES AND TESTING OKAY… ">RAN ALL ONES TEST PATTERN FOR 5 MINUTES AND TESTING OKAY…</option>
<option value=" RAN ALL ONES TEST PATTERN AND FINDING ERRORS…">RAN ALL ONES TEST PATTERN AND FINDING ERRORS…</option>
<option value=" RAN 3-IN-24 TEST PATTERN FOR 5 MINUTES AND TESTING OKAY… ">RAN 3-IN-24 TEST PATTERN FOR 5 MINUTES AND TESTING OKAY…</option>
<option value=" RAN 3-IN-24 TEST PATTERN AND FINDING ERRORS…">RAN 3-IN-24 TEST PATTERN AND FINDING ERRORS…</option>
<option value=" RAN MULTIPAT TEST PATTERN FOR 5 MINUTES AND TESTING OKAY… ">RAN MULTIPAT TEST PATTERN FOR 5 MINUTES AND TESTING OKAY…</option>
<option value=" RAN MULTIPAT TEST PATTERN AND FINDING ERRORS…">RAN MULTIPAT TEST PATTERN AND FINDING ERRORS…</option>
</select>
<script>
var mytextbox = document.getElementById('REMARKSTEXTAREA');
var mydropdown = document.getElementById('testingdropdownmenu');
mydropdown.onchange = function() if (mydropdown != null) {
if (mydropdown.value == 1) {
var TIME = prompt("HOW MANY MINUTES DID YOU RUN THE TEST PATTERN FOR?");
mytextbox.value = mytextbox.value + " RAN QRSS TEST PATTERN FOR " + TIME + "MINUTES AND TESTING OKAY...";
this.value = "";
} else if (mydropdown.value == 2) {
var TIME = prompt("HOW MANY SECONDS DID YOU RUN THE TEST PATTERN FOR?");
mytextbox.value = mytextbox.value + " RAN ALL ZEROES TEST PATTERN FOR " + TIME + " SECONDS AND TESTING OKAY…";
this.value = "";
} else if (mydropdown.value == 3) {
var TIME = prompt("HOW MANY MINUTES DID YOU RUN THE TEST PATTERN FOR?");
mytextbox.value = mytextbox.value + " RAN T-DALY TEST PATTERN FOR " + TIME + " MINUTES AND TESTING OKAY…";
this.value = "";
} else if (mydropdown.value == 4) {
var TIME = prompt("HOW MANY MINUTES DID YOU RUN THE TEST PATTERN FOR?");
mytextbox.value = mytextbox.value + " RAN 1:8 TEST PATTERN FOR " + TIME + " MINUTES AND TESTING OKAY…";
this.value = "";
} else if (mydropdown.value == 5) {
var TIME = prompt("HOW MANY MINUTES DID YOU RUN THE TEST PATTERN FOR?");
mytextbox.value = mytextbox.value + " RAN 1:7 TEST PATTERN FOR " + TIME + " MINUTES AND TESTING OKAY…";
this.value = "";
} else if (mydropdown.value == 6) {
var TIME = prompt("HOW MANY MINUTES DID YOU RUN THE TEST PATTERN FOR?");
mytextbox.value = mytextbox.value + " RAN 2-IN-8 TEST PATTERN FOR " + TIME + " MINUTES AND TESTING OKAY…";
this.value = "";
} else if (mydropdown.value == 7) {
var TIME = prompt("HOW MANY MINUTES DID YOU RUN THE TEST PATTERN FOR?");
mytextbox.value = mytextbox.value + " RAN BRIDGETAP TEST PATTERN FOR " + TIME + " MINUTES AND TESTING OKAY…";
this.value = "";
} else if (mydropdown.value == 8) {
var TIME = prompt("HOW MANY MINUTES DID YOU RUN THE TEST PATTERN FOR?");
mytextbox.value = mytextbox.value + " RAN ALL ONES TEST PATTERN FOR " + TIME + " MINUTES AND TESTING OKAY…";
this.value = "";
} else {
mytextbox.value = mytextbox.value + " " + mydropdown + "...";
this.value = "";
}
}
}
}
</script>
</td>
<!-- END TESTING PATTERNS MENU -->
檢查你的開發人員工具控制檯錯誤 –
語法錯誤附近'()的函數,如果(mydropdown!= NULL){'。檢查您的控制檯的細節。 – techfoobar
^我建議通過控制檯查看,然後你會看到大量的錯誤被提出。 – Li357