에 작동하지 않는 것은 자바 스크립트 오류가 발생합니다 : catch되지 않은 형식 오류 : 나는 무엇을 말할 수에서 onchange를OnChange 이벤트 코드에 따라 선택 상자
는이 스크립트가 작동합니다 orderquantity : 정의되지 않은 함수가 아닙니다. 나는이 문제를 꽤 많이 봤다. 모든 sugestions에는 충돌을 일으키지 않도록 이름 바꾸기가 포함되어 있지만 충돌하는 요소 이름이나 ID가 없는지 확인했다.
인쇄상의 문제 일 수 있지만 문제를 찾을 수 없습니다. 도와주세요.
<script type="text/javascript">
function orderquantity(myvalue)
{
if (myvalue == "Custom") {
document.getElementByID('cquant').style.display="inline-block";
}else{
document.getElementByID('cquant').style.display="none";
document.getElementByID('customquant').value="";
}
}
</script>
<select name="quantity" id="quant" onchange="orderquantity(this.selectedIndex);">
<option value="MatchLast" selected="selected">Same as Last Time</option>
<option value="500">500</option>
<option value="1000">1000</option>
<option value="2500">2500</option>
<option value="5000">5000</option>
<option value="10000">10000</option>
<option value="Custom">Custom Quantity</option>
</select>
<div id="cquant" style="display: none;">
<input type="text" name="CustomAmount" id="customquant">
</div>