Forums
This topic is locked
Dynamic List/Menu
Posted 15 Mar 2007 18:38:52
1
has voted
15 Mar 2007 18:38:52 zafarana gisondi posted:
I'm wondering if smoeone can help me out with this little problem. I have finally created a list/menu that dynamically fills itself. I also have another dynamic table on the page that displays stats from the entire day. I'm trying to create a sort of filter with my dynamic list/menu but nothing seems to work. I would like it so that when the user clicks the option in the drop down, the table below should update it self based on the value selected. I just can't seem to get the query to change based on the selection, any help would be greatly appreciated.zaf
Replies
Replied 16 Mar 2007 16:42:42
16 Mar 2007 16:42:42 zafarana gisondi replied:
Could someone pleeeeeeeeeease help me it's driving me crazy <img src=../images/dmxzone/forum/icon_smile_sad.gif border=0 align=middle>
Replied 16 Mar 2007 17:23:25
16 Mar 2007 17:23:25 Alan C replied:
HI
This sounds like you will have to put in some code that receives the value from the first dynamic list, and depending on what it is, generates whatever goes into the second dynamic list.
I don't do most of my coding in DW, I like to hand-code for more control, so can't be too specific about that, but if I was hand-coding it I would have either a long if then elseif . . . . elseif . . . elseif, or maybe a switch statement.
Essentially - look at the value that comes in from the first list, then blocks of code that produce the new list on the revised page.
Sorry I can't be more specific - not enough info
This sounds like you will have to put in some code that receives the value from the first dynamic list, and depending on what it is, generates whatever goes into the second dynamic list.
I don't do most of my coding in DW, I like to hand-code for more control, so can't be too specific about that, but if I was hand-coding it I would have either a long if then elseif . . . . elseif . . . elseif, or maybe a switch statement.
Essentially - look at the value that comes in from the first list, then blocks of code that produce the new list on the revised page.
Sorry I can't be more specific - not enough info
Replied 16 Mar 2007 18:52:29
16 Mar 2007 18:52:29 zafarana gisondi replied:
I'm not sure how to do that. Let me give you an example:
this is my dynamic drop down
<select name="select" onChange="" >
<option value="Select">Select</option>
<%
while (Day_hasData) {
%>
<option value="<%=((Day.getObject("lev"!=null)?Day.getObject("lev":""%>"><%=((Day.getObject("lev"!=null)?Day.getObject("lev":""%></option>
<%
I guess I need to capture the value of the option somehow from here, where I can create a function and call it in the onChange="" area.
this is my dynamic data table
<table width="205" border="1" id="table1">
<tr>
<td class="style1">Time</td>
<td class="style1">lev</td>
.........
.........
.........
<% while ((Day_hasData)&&(Repeat1__numRows-- != 0)) { %>
<tr>
<td class="style1"><%=(((Day_data = Day.getObject("Time")==null || Day.wasNull())?""ay_data)%></td>
<td class="style1"><%=(((Day_data = Day.getObject("lev")==null || Day.wasNull())?""ay_data)%></td>
.....
.....
I would be greatful if anyone could assist me !!!!
this is my dynamic drop down
<select name="select" onChange="" >
<option value="Select">Select</option>
<%
while (Day_hasData) {
%>
<option value="<%=((Day.getObject("lev"!=null)?Day.getObject("lev":""%>"><%=((Day.getObject("lev"!=null)?Day.getObject("lev":""%></option>
<%
I guess I need to capture the value of the option somehow from here, where I can create a function and call it in the onChange="" area.
this is my dynamic data table
<table width="205" border="1" id="table1">
<tr>
<td class="style1">Time</td>
<td class="style1">lev</td>
.........
.........
.........
<% while ((Day_hasData)&&(Repeat1__numRows-- != 0)) { %>
<tr>
<td class="style1"><%=(((Day_data = Day.getObject("Time")==null || Day.wasNull())?""ay_data)%></td>
<td class="style1"><%=(((Day_data = Day.getObject("lev")==null || Day.wasNull())?""ay_data)%></td>
.....
.....
I would be greatful if anyone could assist me !!!!
Replied 19 Mar 2007 18:52:29
19 Mar 2007 18:52:29 Alan C replied:
sorry I don't do asp, but have done similar in php, so this might help . . .
the select box has name/value pairs, so where the user clicks it to select the form sends data, which is probably going back using the POST method, in php all the inputs are then available in a special array called $_POST which you can access using the names of the form inputs like . . . say your select had the name pets, then you would pick up the user selection by
<pre id=code><font face=courier size=2 id=code>$user_selection_from_pets = $_POST['pets']; </font id=code></pre id=code>
once you have that value you can decide what to do to present the next select dropdown
Hope that helps or stimulates some who does asp to wade in <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
Just a thought - this might get more attention in the asp topic area
Edited by - sitemaster on 19 Mar 2007 19:06:27
the select box has name/value pairs, so where the user clicks it to select the form sends data, which is probably going back using the POST method, in php all the inputs are then available in a special array called $_POST which you can access using the names of the form inputs like . . . say your select had the name pets, then you would pick up the user selection by
<pre id=code><font face=courier size=2 id=code>$user_selection_from_pets = $_POST['pets']; </font id=code></pre id=code>
once you have that value you can decide what to do to present the next select dropdown
Hope that helps or stimulates some who does asp to wade in <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
Just a thought - this might get more attention in the asp topic area
Edited by - sitemaster on 19 Mar 2007 19:06:27
Replied 20 Mar 2007 16:17:29
20 Mar 2007 16:17:29 Alan C replied:
I just visitied d-link.com looking for something else and noticed that they have a select box and their support page that changes a second select box, I don't have time to pick the code apart but you might
it's here
support.dlink.ca/supportfaq/
it's here
support.dlink.ca/supportfaq/
Replied 22 Mar 2007 10:26:29
22 Mar 2007 10:26:29 Louise Elastic replied:
<script>
startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav"
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI" {
node.onmouseover=function() {
this.className+=" over";
}
node.onmouseout=function() {
this.className=this.className.replace(" over", ""
}
}
}
}
}
window.onload=startList;
</script>
<style>
body {
font: normal 11px verdana;
}
ul {
margin: 0;
padding: 0;
list-style: none;
width: 150px; /* Width of Menu Items */
border-bottom: 1px solid #ccc;
}
ul li {
position: relative;
}
li ul {
position: absolute;
left: 149px; /* Set 1px less than menu width */
top: 0;
display: none;
}
/* Styles for Menu Items */
ul li a {
display: block;
text-decoration: none;
color: #777;
background: #fff; /* IE6 Bug */
padding: 5px;
border: 1px solid #ccc;
border-bottom: 0;
}
/* Fix IE. Hide from IE Mac \*/
* html ul li { float: left; height: 1%; }
* html ul li a { height: 1%; }
/* End */
ul li a:hover { color: #E2144A; background: #f9f9f9; } /* Hover Styles */
li ul li a { padding: 2px 5px; } /* Sub Menu Styles */
li:hover ul, li.over ul { display: block; } /* The magic */
</style>
</head>
<body>
<ul id="nav">
<li><a href="#">Home</a></li>
<li><a href="#">About</a>
<ul>
<li><a href="#">History</a></li>
<li><a href="#">Team</a></li>
<li><a href="#">Offices</a></li>
</ul>
</li>
<li><a href="#">Services</a>
<ul>
<li><a href="#">Web Design</a></li>
<li><a href="#">Internet Marketing</a></li>
<li><a href="#">Hosting</a></li>
<li><a href="#">Domain Names</a></li>
<li><a href="#">Broadband</a></li>
</ul>
</li>
<li><a href="#">Contact Us</a>
<ul>
<li><a href="#">United Kingdom</a></li>
<li><a href="#">France</a></li>
<li><a href="#">USA</a></li>
<li><a href="#">Australia</a></li>
</ul>
</li>
</ul>
</body>
Apple TV Converter News
www.appletvconverter.net
startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("nav"
for (i=0; i<navRoot.childNodes.length; i++) {
node = navRoot.childNodes[i];
if (node.nodeName=="LI" {
node.onmouseover=function() {
this.className+=" over";
}
node.onmouseout=function() {
this.className=this.className.replace(" over", ""
}
}
}
}
}
window.onload=startList;
</script>
<style>
body {
font: normal 11px verdana;
}
ul {
margin: 0;
padding: 0;
list-style: none;
width: 150px; /* Width of Menu Items */
border-bottom: 1px solid #ccc;
}
ul li {
position: relative;
}
li ul {
position: absolute;
left: 149px; /* Set 1px less than menu width */
top: 0;
display: none;
}
/* Styles for Menu Items */
ul li a {
display: block;
text-decoration: none;
color: #777;
background: #fff; /* IE6 Bug */
padding: 5px;
border: 1px solid #ccc;
border-bottom: 0;
}
/* Fix IE. Hide from IE Mac \*/
* html ul li { float: left; height: 1%; }
* html ul li a { height: 1%; }
/* End */
ul li a:hover { color: #E2144A; background: #f9f9f9; } /* Hover Styles */
li ul li a { padding: 2px 5px; } /* Sub Menu Styles */
li:hover ul, li.over ul { display: block; } /* The magic */
</style>
</head>
<body>
<ul id="nav">
<li><a href="#">Home</a></li>
<li><a href="#">About</a>
<ul>
<li><a href="#">History</a></li>
<li><a href="#">Team</a></li>
<li><a href="#">Offices</a></li>
</ul>
</li>
<li><a href="#">Services</a>
<ul>
<li><a href="#">Web Design</a></li>
<li><a href="#">Internet Marketing</a></li>
<li><a href="#">Hosting</a></li>
<li><a href="#">Domain Names</a></li>
<li><a href="#">Broadband</a></li>
</ul>
</li>
<li><a href="#">Contact Us</a>
<ul>
<li><a href="#">United Kingdom</a></li>
<li><a href="#">France</a></li>
<li><a href="#">USA</a></li>
<li><a href="#">Australia</a></li>
</ul>
</li>
</ul>
</body>
Apple TV Converter News
www.appletvconverter.net
Replied 28 Mar 2007 19:35:50
28 Mar 2007 19:35:50 zafarana gisondi replied:
Thanks for everyones input. I just used this.value to get the value from the drop down. that's all. and it works