0
이 양식을 양식에 추가하고 싶습니다. 드롭 다운 메뉴에서 옵션을 선택하면 위의 텍스트 필드에 해당 정보를 입력해야합니다.배열의 데이터를 텍스트 필드에 넣는 드롭 다운 메뉴를 만들려면 어떻게합니까?
objBMW = {
"Sedan":"5-series",
"Convertible":"6-series",
"Truck":"X5",
"Coupe":"3-series",
"Hatchback":"5-series GT"
};
<form name="form1" action="formhandler">
<input type="text" name="typecar">
<select name="BMWCars">
<option value="Sedan">Sedan</option> // when this option is chosen put string "5-series" in textfield above
<option value="Convertible">Convertible</option> // when this option is chosen put string "6-series" in textfield above
<option value="Truck">Truck</option> // when this option is chosen put string "X5" in textfield above
<option value="Coupe">Coupe</option> // when this option is chosen put string "3-series" in textfield above
<option value="Hatchback">Hatchback</option> // when this option is chosen put string "5-series GT" in textfield above
</select>
나는이 단지 내가 가진 ** ** 경우를 할 것 제품을 신속하게 전달할 수 있습니다. 그렇지 않으면 PHP와 HTML 코드가 섞이지 않도록 최선을 다할 것입니다. 이것은 장기적으로 볼 때 추악하고 유지 보수가 불가능합니다. 그리고 미안하지만 jquery를 사용하는 것은 실제로 필요하지 않지만 썰매 망치를 사용하여 너트를 깨는 것과 같습니다. –