Select Menu Information Changer - Condense a FAQ's or Information using a select menu to change the content.
Compatible Browsers: Example: View Code Demo |
<html>
<head>
<title>Select Menu Information Changer Javascript Code Snippet</title>
<script>
<!-- Begin Select Menu Information Changer from http://snapbuilder.com Free Public Codes Library
// Free to use as long as the credit lines remain in place
var messages = new Array(6);
messages[0] = ""; // leave this blank
messages[1] = "This is topic #1 content.";
messages[2] = "This is topic #2 content.";
messages[3] = "This is topic #3 content.";
messages[4] = "This is topic #4 content.";
messages[5] = "This is topic #5 content.";
function messageReveal() {
var messageindex = document.messageForm.messagePick.selectedIndex
document.messageForm.messageField.value = messages[messageindex];
}
// End -->
</script>
</head>
<body>
<center>
<form name="messageForm">
<select name="messagePick" OnChange="messageReveal();">
<option value="0">Select Topic Choice</option>
<option>Topic #1 Title</option>
<option>Topic #2 Title</option>
<option>Topic #3 Title</option>
<option>Topic #4 Title</option>
<option>Topic #5 Title</option>
</select>
<br />
<textarea name="messageField" rows="5" cols="50" wrap="virtual"></textarea>
</form>
</center>
</body>
</html>
|
Scroll