witold
07-26-2003, 06:36 PM
Hi,
I'd like to print an image depending on the value change in a dropdown list
<SELECT NAME="m1" size="1">
<option value="1" selected>img1</option>
<option value="2">img2</option>
<option value="3">img3</option>
</SELECT>
I use the following coding to make the image change, but nothing happens. I obviously miss somthing, but have no idea what.
if (window.document.form.m1.value == 1) {
document.images.show.src = "img1.jpg";
}
if (window.document.form.m1.value == 2) {
document.images.show.src = "img2.jpg";
}
document.write ('<img.src="" name="show">');
maybe I need some onChange action... hope someone gives me a hint.
witold
I'd like to print an image depending on the value change in a dropdown list
<SELECT NAME="m1" size="1">
<option value="1" selected>img1</option>
<option value="2">img2</option>
<option value="3">img3</option>
</SELECT>
I use the following coding to make the image change, but nothing happens. I obviously miss somthing, but have no idea what.
if (window.document.form.m1.value == 1) {
document.images.show.src = "img1.jpg";
}
if (window.document.form.m1.value == 2) {
document.images.show.src = "img2.jpg";
}
document.write ('<img.src="" name="show">');
maybe I need some onChange action... hope someone gives me a hint.
witold