Snap Builder Public Codes Library
Snap | Generators | Login | Browse | Search | Enter Code | Export Snap Builder Public Codes Library


Category: Javascript Codes Library >> Miscellaneous Snippets >> Select Menu Information Changer

Code Snippet </> Info

Snippet Name: Select Menu Information Changer

Description: Condense a FAQ's or Information using a select menu to change the content.

Compatible Browsers:
Chrome BrowserFirefox BrowserInternet Explorer BrowserOpera BrowserSafari Browser

Example: View Code Demo

Note: Simply adjust the var messages to your needs... add as many as you need by adding a new messages[6] = "This is topic #6 content."; in the HEAD area and adding another option tag in the BODY area.

Author: SnapBuilder <>

Last Modified: 2014-05-04 16:23:39

Language: javascript

Highlight Mode: javascript

Copy Codes: Use Free Notepad ++
Bookmark and Share

Snap HTML Code Editor:
Paste the source code, make changes and instantly see it in live preview.
Snap HTML Code Editor

  About Copying
Copied To Clipboard!

<html> <head> <title>Select Menu Information Changer Javascript Code Snippet</title> <script> <!-- Begin Select Menu Information Changer from 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>

[ Snippet Options ]


© 2002 -  Snap Builder Public Codes Library