SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2004
    Location
    pt
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    dilplaying text with list menu

    Hi.

    I have this code:
    How can i change it so it would display simple text instead of an image?

    Code:
    <select class="control" name="reservation.carclass" size=1  tabindex="1" onChange="modifyCarImage(this)">
    						<option  value="M">Mini</option>
    						<option  value="E">Economy</option>
    						<option selected value="C">Compact</option>
    						<option  value="I">Intermediate</option>
    						<option  value="S">Standard</option>
    						<option  value="F">Full-Size</option>
    						<option  value="P">Premium</option>
    						<option  value="L">Luxury</option>
    						<option  value="MV">People carriers/MPVs & Minivans</option>
    						<option  value="TR">Trucks</option>
    						<option  value="SP">Special Cars</option>
    						<option  value="OT">Other vehicles</option>
    					</select>
    <img alt="" name="CarImage" src="/images/ans/M.jpg" border="0" align="absmiddle">
    <script type="text/javascript">
    		function modifyCarImage(select){
    		switch(select.value) {
    			case "M":
    				document.CarImage.src = "4009470475.gif";
    				break;
    			case "E":
    				document.CarImage.src = "/images/ans/E.jpg";
    				break;
    			case "C":
    				document.CarImage.src = "/images/ans/C.jpg";
    				break;
    			case "I":
    				document.CarImage.src = "/images/ans/I.jpg";
    				break;
    			case "S":
    				document.CarImage.src = "/images/ans/S.jpg";
    				break;
    			case "F":
    				document.CarImage.src = "/images/ans/F.jpg";
    				break;
    			case "P":
    				document.CarImage.src = "/images/ans/P.jpg";
    				break;
    			case "L":
    				document.CarImage.src = "/images/ans/L.jpg";
    				break;
    			case "MV":
    				document.CarImage.src = "/images/ans/mv.jpg";
    				break;
    			case "TR":
    				document.CarImage.src = "/images/ans/tr.jpg";
    				break;
    			case "SP":
    				document.CarImage.src = "/images/ans/sp.jpg";
    				break;
    			case "OT":
    				document.CarImage.src = "/images/ans/ot.jpg";
    				break;
    		}
    	}
    
    -->
    </script>


    THanks

  2. #2
    SitePoint Enthusiast
    Join Date
    Jul 2004
    Location
    pt
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)


Bookmarks

Posting Permissions

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