0
사람이이 오류와 함께 나를 도울 수 있다면 나는 감사합니다 JSON 코드에
스피 newbi : 나는 자동차 모델 + 년도 + 보증금 + 가격을 가지고 을JSON 드롭 다운 목록 오류
때 연도를 선택보다 사용자가 첫 번째 클릭 모델 예금은 월간 금액을 지불합니다. 사전에
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Cars</title>
<link href="css/cakeform.css" rel="stylesheet" type="text/css" />
<script>
var prices = {
'model' : 'Skoda' {
'1' : {
'12300' : '959',
'13000' : '892',
'13500' : '844',
'19000' : '317'
},
'2' : {
'12300' : '542',
'13000' : '504',
'13500' : '477',
'19000' : '179'
},
'3' : {
'12300' : '403',
'13000' : '375',
'13500' : '355',
'19000' : '133'
}
};
'Tiida' {
'1' : {
'12300' : '955',
'13000' : '892',
'13500' : '844',
'19000' : '317'
},
'2' : {
'12300' : '555',
'13000' : '504',
'13500' : '477',
'19000' : '179'
},
'3' : {
'12300' : '455',
'13000' : '375',
'13500' : '355',
'19000' : '133'
}
};
};
onload = function(){
var f = document.booklets;
var model = f.model;
var qtyEl = f.qty;
var pagesEl = f.pages;
var priceEl = document.getElementById('price');
f.qty.onchange = f.pages.onchange = f.model.onchange = function(){
var qty = qtyEl[qtyEl.selectedIndex].value;
var model = modelEl[modelEl.selectedIndex].value;
var pages = pagesEl[pagesEl.selectedIndex].value
priceEl.innerHTML = prices[pages][qty][model];
};
f.qty.onchange();//initialise price field for whatever values are selected on page load
};
</script>
</head>
<body>
<fieldset>
<legend>Cars</legend>
<form name="booklets" method="" action="">
<div>Select Model:
<select class="selectClass" name="model">
<option value="Skoda">Skoda</option>
<option value="Tiida">Tiida</option>
<option value="Tyota">Toyota</option>
</select>
<div>Select Year:
<select class="selectClass" name="pages">
<option value="1">1 Year</option>
<option value="2">2 Years</option>
<option value="3">3 Years....</option>
</select>
<br><br>Select Deposit:
<select class="selectClass" name="qty">
<option value="12300">$12300</option>
<option value="13000">$13000</option>
<option value="13500">$13500</option>
</select>
</div>
<div><br>Monthly Payment: <font color="blue" size=7>$ <span id="price"></span> </font> </div>
</form>
</fieldset>
</body>
</html>
감사 : 그 고정해야했다, 그래서
놀라운 사람입니다. 고마워요. – user1710911