Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: Help Diplaying Message according to month


Message #1 by "Stan Sawyer" <stansawyer@y...> on Tue, 13 Mar 2001 03:17:24
I need a function that will display a different message according to month 
and a value that was chosen through an array with a text box.  It needs to 
written with a switch statement.  If the month is April or may it reads 
one statement if it is September or October it reads another statement.  
If no conditions match it reads a nother message.  Please help.  Very 
important.

<html>
<head>
   <title>Three River's Fencing</title>
<script language="javascript">

<!-- hide from old browsers
banners = new Array("fence1.jpg","fence2.jpg","fence3.jpg")
var count = 0
function rollBanner()
	{
        count = count + 1
        if (count==3){
        count = 0}
        document.banner.src = banners[count]
        setTimeout("rollBanner()",3000)

     }
	 
var price = new Array(5); 
price[0] = "";
price[1] = "$1,250.00"
price[2] = "$1,400.00"  
price[3] = "$2,500.00"
price[4] = "$1,395.00"

function displayPrice()
	{
		var priceindex = deckMenu.deckList.selectedIndex
		deckMenu.price.value = price[priceindex]
	}
	

//-->
</script>
</head>

<body onload="rollBanner()">
<P align="center"><img src="Fencelogo.jpg">

<table border="1" width="60%">
  <tr>
    <td width="50%" align="center"><img src="fence1.jpg" 
Name="banner"></td>
    <td width="50%"><p align="center"><h2><font color="#008040">Select a 
style of deck from the drop down list and click price to see the 
cost.</font></h2></td>
  </tr>
  <tr>
     <TD COLSPAN=2>
        <B>Deck Styles</B>
        <form name="deckMenu">
		<select name="deckList">
		<option>Select
		<option>10 Foot Hexigon
		<option>12 X 12 Cedar Traditional
		<option>10 X 24 Bi-level
		<option>Special Sizes
		</select>
		<br>
		<br>
		<input type="text" name="price" value=" ">
		<br><br>
		<input type="button" name="pricebutton" value="Price" 
onclick="displayPrice()">
		</form>
  		</td>
          <SCRIPT LANGUAGE="JAVASCRIPT">
          <!--Hide from old Browsers
		  
          // Place message function call here
          //-->
          </SCRIPT>
  </tr>
    
</table>

</body>
</html>

  Return to Index