View Single Post
Old 06-30-2012, 04:21 PM   PM User | #2
sunfighter
Senior Coder

 
Join Date: Jan 2011
Location: Missouri
Posts: 2,364
Thanks: 18
Thanked 347 Times in 346 Posts
sunfighter is on a distinguished road
This is a little simpler code:
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>
<script type="text/javascript">
function find_select()
{
	if (document.getElementById("help").selected == true)
	{
		document.getElementById('help_form').style.display = 'block';
		document.getElementById('feedback_form').style.display = 'none';
	}
	else if (document.getElementById("feedback").selected == true)
	{
		document.getElementById('help_form').style.display = 'none';
		document.getElementById('feedback_form').style.display = 'block';
	}
	else{
		document.getElementById('help_form').style.display = 'none';
		document.getElementById('feedback_form').style.display = 'none';
	}
}
</script>
</head>
<body>
<select name="select_form" id="select_form" onchange="find_select()">
  <option id="blank" value="blank"></option>
  <option id="help" value="help">Help Request</option>
  <option id="feedback" value="feedback">Feedback</option>
</select>

<div id="help_form" style="font:24px bold; display: none;">help</div>
<div id="feedback_form" style="font:24px bold; display: none;">feedback</div>
</body>
</html>
Since your options have an ID (which I use myself) I went right to the source.
sunfighter is online now   Reply With Quote
Users who have thanked sunfighter for this post:
captainbarred (06-30-2012)