View Single Post
Old 07-07-2009, 04:59 PM   PM User | #2
vwphillips
Senior Coder

 
Join Date: Mar 2005
Location: Portsmouth UK
Posts: 4,379
Thanks: 3
Thanked 466 Times in 453 Posts
vwphillips is a jewel in the roughvwphillips is a jewel in the roughvwphillips is a jewel in the rough
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
  <title></title>
</head>

<body>
<script language="javascript">

function Go(oSelect)
{
 var oDiv = [document.getElementById('form2a'),document.getElementById('form2b'),document.getElementById('form2c')]
 var data = oSelect.value;
 for (var z0=0;z0<oDiv.length;z0++) oDiv[z0].style.display = 'block';
 if(oDiv[data-2]) oDiv[data-2].style.display = 'none';
}
</script>
</head>

<body>
<form name="form1">
<select name="data" size="1" onchange="return Go(this)">
<option value selected="selected">Select</option>
<option name="1" value="1">select1</option>
<option name="2" value="2">select2</option>
<option name="3" value="3">select3</option>
<option name="4" value="4">select4</option>
</select>
</form>
<div id="form2a" style="display:none">
shows content ONE
</div>
<div id="form2b" style="display:none">
shows content TWO
</div>
<div id="form2c" style="display:none">
shows content Three
</div>
</body>

</html>
__________________
Vic

God Loves You and will never love you less.

http://www.vicsjavascripts.org.uk/

If my post has been useful please donate to http://www.operationsmile.org.uk/
vwphillips is offline   Reply With Quote
Users who have thanked vwphillips for this post:
benlekreme (07-07-2009)