...

View Full Version : why doesnt this work with anything but i.e 6?



Bluemonkey
10-09-2002, 03:40 PM
<a href="#" onClick="imgsel(1)"><img src="boat.jpg" width="100" height="142" border="0"></a>

<script language="VBScript">
<!--

sub imgsel(iValue)

dim finalimage

finalimage = ""

select case iValue

case 1
imageselect.hiddenval.value= "boat"
case 2
imageselect.hiddenval.value= "girl_tulip"
case 3
imageselect.hiddenval.value= "green_baby"
case 4
imageselect.hiddenval.value= "lilac_kittins"
case 5
imageselect.hiddenval.value= "rose"
case 6
imageselect.hiddenval.value= "sky_sun"
case 7
imageselect.hiddenval.value= "sunflower"
end select

imageselect.submit

end sub


-->
</script>

this works fine in ie6 but not in anything else.


thanks for the help

Roy Sinclair
10-09-2002, 06:26 PM
Because it's written in VBScript, a language that's only supported by MS. If that had been written in Javascript it's likely it would work in all the browsers.

jkd
10-09-2002, 06:37 PM
This *should* be the equivalent Javascript:



function imgsel(iValue) {
var finalimage = "";
switch (iValue) {
case 1:
imageselect.hiddenval.value= "boat";
break;
case 2:
imageselect.hiddenval.value= "girl_tulip";
break;
case 3:
imageselect.hiddenval.value= "green_baby";
break;
case 4:
imageselect.hiddenval.value= "lilac_kittins";
break;
case 5:
imageselect.hiddenval.value= "rose";
break;
case 6:
imageselect.hiddenval.value= "sky_sun";
break;
case 7:
imageselect.hiddenval.value= "sunflower";
break;
}
imageselect.submit();
}

Bluemonkey
10-10-2002, 02:14 PM
thanks for the help



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum