I am trying to make the object "flight1pic" change depending on what is selected in the drop down menus "airline1" and "aircraft1".
My problem is when changing "airline1" it all works fine, but when changing "aircraft1" i get the error:
Line: 1
Char: 1
Error: Object Expected
Code: 0
Expand|Select|Wrap|Line Numbers
- function flightpicFunction(){
- if(document.getElementById('airline1').value == "Qantaslink" && document.getElementById('aircraft1').value == "Boeing 717"){ document.getElementById('flight1pic').innerHTML = "<img src=../images/aircraft/QF_B717.jpg>"; }
- if(document.getElementById('airline1').value == "Skywest" && document.getElementById('aircraft1').value == "Fokker 100"){ document.getElementById('flight1pic').innerHTML = "<img src=../images/aircraft/XR_F100.jpg>"; }
- }
Expand|Select|Wrap|Line Numbers
- <select size="1" onChange="flightpicFunction();" name="aircraft1" tabindex="3">
- <option value="BAe 146">BAe 146</option>
- <option value="Boeing 717">Boeing 717</option>
- <option value="Boeing 737">Boeing 737</option>
- <option value="Dash 8">Dash 8</option>
- <option value="Embraer 120">Embraer 120</option>
- <option value="Embraer 145">Embraer 145</option>
- <option value="Embraer 170">Embraer 170</option>
- <option value="Embraer 190">Embraer 190</option>
- <option value="Fokker 100">Fokker 100</option>
- <option value="Fokker 50">Fokker 50</option>
- <option value="Other">Other</option>
- </select>