셀렉트 박스의 옵션을 선택시에 이미지 미리보기는 어떻게 하나요

무제-1.gif
첨부이미지는 목진철님의 빌더테스트 화면을 캡쳐한 것입니다

셀렉트 박스의 옵션을 선택할 때마다 아이콘이 변하는 데 ..

어떻게 하는 것인지 설명좀 부탁합니다

첨부파일

무제-1.gif (844 bytes)
0회 2008-01-15 23:27
|

댓글 2개

아래를 참조해보세요

<script>
function selectForm(frm){
var hiddenForms = document.getElementById("allForms");


theForm = hiddenForms.getElementsByTagName("div");

for(x=0; x<theForm.length; x++){
theForm[x].style.display = "none";
}


if (theForm[frm-1]){
theForm[frm-1].style.display = "block";
}
}
</script>







<select id="someID" name="someID" onChange="selectForm(this.options[this.selectedIndex].value)" style=width:200>
<option> ---선택---</option>
<option value="1"> 질문 1</option>
<option value="2"> 질문 2</option>
<option value="3"> 질문 3</option>
</select>

<div id="allForms">
<div style="color: #000; background:#EFE3C2; width:200px; padding: 10px; display:none;">
<img src=경로>
</div>
<div style="color: #000; background:#FFCC66; width:200px; padding: 10px; display:none;">
<img src=경로>
</div>
<div style="color: #000; background:#66FFCC; width:200px; padding: 10px; display:none;">
<img src=경로>
</div>
</div>
초파님//답변감사합니다..

그런데 아래는 무슨 문제가 있나요..계속 오류가 있어서요

<script language="javascript">
<!--
function showimage() {
if (!document.images)
return
document.images.pictures1.src="<?=$g4[path]?>/builder_skin/menu_main/<?=$config3[cf_1_3menumain]?>/"+document.fconfigform.cf_21_3menumain.options[document.fconfigform.cf_21_3menumain.selectedIndex].value"/img/";
}
//-->
</script>

<td><select id=cf_21_3menumain name=cf_21_3menumain required itemname="아이콘" onChange="showimage()">
<? $a = "menu_01/menu_02/menu_03/menu_04/menu_05";
$b = explode("/",$a);
$c =count($b);
?>
<? for($i=0;$i<$c;$i++){?>
<? echo "<option value='$b[$i]'>$b[$i]</option>\n";
}
?>
</select>
<script language="JavaScript"> document.getElementById('cf_21_3menumain').value="<?=$config3[cf_21_3menumain]?>";</script></td></tr>

<tr class='ht'>
<td></td>
<td></td>
<td></td>
<td><IMG src="<?=$g4[path]?>/builder_skin/menu_main/<?=$config3[cf_1_3menumain]?>/img/<?=$config3[cf_21_3menumain]?>_02.gif" BORDER="0" ALT="" name="pictures"></td>
</tr>
댓글을 작성하시려면 로그인이 필요합니다. 로그인

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
18년 전 조회 1,568
18년 전 조회 1,515
18년 전 조회 1,525
18년 전 조회 1,515
18년 전 조회 1,908
18년 전 조회 1,606
18년 전 조회 1,517
18년 전 조회 1,572
18년 전 조회 1,514
18년 전 조회 1,969
18년 전 조회 1,521
18년 전 조회 1,520
18년 전 조회 2,087
18년 전 조회 1,580
18년 전 조회 1,648
18년 전 조회 1,688
18년 전 조회 1,923
18년 전 조회 1,564
18년 전 조회 1,516
18년 전 조회 1,613
🐛 버그신고