Menu
Ok so here is what I am trying to figure out. I need to put 4 dropdown selection menus on a page with a submit button. Each menu will have different choices in it and by the combination of those 4 choices it will display some text on the page. similar to the way a grid would work but without the grid. any ideas on how to do this? know where I can see some code similar to this? any help is greatly appreciated
[code=php]
<html>
<head>
<title> Drop-Down Grid </title>
<script type="text/javascript">
function ShowPicks() {
var str = '';
var DD = '';
for (i=0; i<4; i++) {
DD = document.getElementById('DD'+i);
str += DD.options[DD.selectedIndex].value+'n';
}
return str;
}
</script>
</head>
<body>
<h1> Drop-Down Grid </h1>
<select id="DD0">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
<select id="DD1">
<option value="a">a</option>
<option value="b">b</option>
<option value="c">c</option>
<option value="d">d</option>
<option value="e">e</option>
</select>
<select id="DD2">
<option value="one">one</option>
<option value="two">two</option>
<option value="three">three</option>
<option value="four">four</option>
<option value="five">five</option>
</select>
<select id="DD3">
<option value="A">A</option>
<option value="B">B</option>
<option value="C">C</option>
<option value="D">D</option>
<option value="E">E</option>
</select>
<button onClick="document.getElementById('Picks').value=ShowPicks()">Pseudo-Submit</button>
<br>
<textarea id="Picks" rows="5"></textarea>
</body>
</html>
[/code]
[CODE]<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Services</title>
<link href="layout.css" rel="stylesheet" type="text/css" />
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body id="page_3">
<div class="mbg">
<div class="main">
<!--==========header=========== -->
<div id="header">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,24"
width="766" height="427">
<param name="movie" value="flash/header_v8.swf?button=3" />
<param name="quality" value="high" />
<param name="menu" value="false" />
<!--[if !IE]> <-->
<object data="flash/header_v8.swf?button=3"
width="766" height="427" type="application/x-shockwave-flash">
<param name="quality" value="high" />
<param name="menu" value="false" />
<param name="pluginurl" value="http://www.macromedia.com/go/getflashplayer" />
FAIL (the browser should render some flash content, not this).
</object>
<!--> <![endif]-->
</object>
</div>
<!--========//header=========== -->
<!-- -->
<!--==========content=========== -->
<div id="content">
<div class="title"><div><img src="images/3_h_1.gif" alt="" /></div></div>
<strong>Please make the proper menu selections below to display your information</strong>
<div class="in5"></div>
<p>Menu bars go here</p>
<p><br />
</p>
<div class="title"><div><img src="images/3_h_2.gif" alt="" /></div></div>
<strong>Text selected by the menu gets displayed here</strong>
<div class="in5"></div>
<div class="in15"></div>
<img src="images/3_pic_1.jpg" class="pic" alt="" />
<strong>bla bla bla space holder</strong>
<strong>bla bla bla space holder</strong>
<div class="in5"></div>
bla bla bla space holderbla bla bla space holderbla bla bla space holderbla bla bla space holderbla bla bla space holderbla bla bla space holderbla bla bla space holder
<br class="clear" />
<div class="in15"></div>
<div class="line_x"><div class="clear"></div></div>
<br />
</div>
<!--========//content=========== -->
</div>
</div>
<!--==========footer=========== -->
<div class="main">
<div id="footer">
<div> © 2008 | <a href="index-6.html">Privacy Policy</a></div>
</div>
</div>
<!--========//footer=========== -->
</body>
</html>[/CODE]
[code=php]
<html>
<head>
<title> Drop-Down Displays </title>
<style type="text/css">
.Togs { display:none; }
</style>
<script type="text/javascript">
function ShowPicks() {
var str = '';
var DD = '';
for (i=0; i<3; i++) {
DD = document.getElementById('DD'+i);
str += DD.options[DD.selectedIndex].value;
}
return 'T'+str;
}
var OldTogs = 'T111';
function Toggle(IDS) {
document.getElementById(OldTogs).style.display = 'none';
document.getElementById(IDS).style.display = 'block';
OldTogs = IDS;
// alert('Selected: '+IDS);
}
// =======================================================
/*
following just used to demonstrate idea
real program should define each <div id="Togs"> contents
where Togs = coded ID for the <div> tag
*/
function CreateDIVs() {
// create fake <div> tags until entered for real
var TogsList = '123456789ABC';
var tog = '';
var str = '';
for (o=0; o<4; o++) {
for (g=0; g<12; g++) {
for (s=0; s<4; s++) {
tog = TogsList.charAt(o)+TogsList.charAt(g)+TogsList.charAt(s);
str += '<div class="Togs" id="T'+tog+'">T'+tog+'</div>';
}
}
}
return str;
}
function ModifyDIVs() {
document.getElementById('T161').innerHTML =
"Plate tectonics accounts for important features of Earth's surface and major geologic events. "+
"<br>As a basis for understanding this concept: "+
"Students know evidence of plate tectonics is derived from the fit of the continents; "+
"the location of earthquakes, volcanoes, and midocean ridges; and the distribution of fossils, "+
"rock types, and ancient climatic zones.";
document.getElementById('T112').innerHTML =
"Scientific progress is made by asking meaningful questions and conducting careful investigations. "+
"As a basis for understanding this concept and addressing the content in the other three strands, "+
"students should develop their own questions and perform investigations. "+
"Students will: Repeat observations to improve accuracy and know that the results of similar scientific "+
"investigations seldom turn out exactly the same because of differences in the things being investigated, "+
"methods being used, or uncertainty in the observation."
}
// could also use an Ajax routine to load in text file here instead.
/*
end of demonstration section
*/
// =======================================================
</script>
</head>
<body onLoad="ModifyDIVs()">
<h1> Drop-Down Displays </h1>
Occupation:
<select id="DD0">
<option value="1">Teacher</option>
<option value="2">Student</option>
<option value="3">Volunteer</option>
<option value="4">Contributor</option>
</select>
Grade: <select id="DD1">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="A">10</option>
<option value="B">11</option>
<option value="C">12</option>
</select>
Section: <select id="DD2">
<option value="1">Science</option>
<option value="2">Technology</option>
<option value="3">Engineering</option>
<option value="4">Mathematics</option>
</select>
<button onClick="Toggle(ShowPicks())">Pseudo-Submit</button>
<p><h2>
Note:
<br>Only 'Teacher, Grade 6 and Science'
<br> and 'Teacher, Grade 1 and Technology' currently active
<h2><p>
<script type="text/javascript">
// demonstration code only ... real information to be inserted here.
// =======================================================
document.write(CreateDIVs());
// =======================================================
</script>
</body>
</html>
[/code]
// alert('Selected: '+IDS);and
}
[/QUOTE]
and
/*
following just used to demonstrate idea
real program should define each <div id="Togs"> contents
where Togs = coded ID for the <div> tag
*/[/QUOTE]
function CreateDIVs() {
// create fake <div> tags until entered for real[/QUOTE]
<i>
</i><div class='Togs' id='T161'>
Plate tectonics accounts for important features of Earth's surface and major geologic events.
<br>As a basis for understanding this concept:
Students know evidence of plate tectonics is derived from the fit of the continents;
the location of earthquakes, volcanoes, and midocean ridges; and the distribution of fossils,
rock types, and ancient climatic zones.
</div>
[CODE]var TogsList = '123456789ABCK';[/CODE]
script but I think it should also be in the [CODE](g=0; g<12; G++)[/CODE]
part as well but I am not sure how to do this.[CODE] var TogsList = '123456789ABCK';
var tog = '';
var str = '';
for (o=0; o<4; o++) {
for (g=0; g<12; g++) {
for (s=0; s<4; s++) {
tog = TogsList.charAt(o)+TogsList.charAt(g)+TogsList.charAt(s);
str += '<div class="Togs" id="T'+tog+'">T'+tog+'</div>';
}
}
}
return str;
}[/CODE]
0.1.9 — BETA 6.17