Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    England, Hythe
    Posts
    207
    Thanks
    0
    Thanked 0 Times in 0 Posts

    why doesnt this work with anything but i.e 6?

    <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

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #3
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    This *should* be the equivalent Javascript:

    Code:
    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();
    }

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Location
    England, Hythe
    Posts
    207
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks for the help


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •