473,409 Members | 1,945 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,409 software developers and data experts.

Problem with second dropdown list

11
I have successfully linked 2 dropdown lists, but then I got greedy and wanted to provide the same information to further dropdown boxes.
What I am trying to do is to select a client and then offer daily shifts dependent on the client selected.
I can only still get the first box (Monday) to subsequently open. Can you see what I am doing wrong and possible come up with a solution.
Code: [php]
// Starting of first drop downlist

echo "<select name='cat' onchange=\"reload(this.form)\"><option value=''>Client</option>";
while($noticia2 = mysql_fetch_array($quer2)) {
if($noticia2['client_id']==@$cat){echo "<option selected value='$noticia2[client_id]'>$noticia2[client]</option>"."<BR>";}
else{echo "<option value='$noticia2[client_id]'>$noticia2[client]</option>";}
}
echo "</select>";

// This will end the first drop down list

?>
<tr>
<td class="label">Monday :</td>
<td class="field">
<?
echo "<select name='Monday'><option value=''></option>";
while($noticia = mysql_fetch_array($quer)) {
echo "<option value='$noticia[hours]'>$noticia[hours]</option>";
}
echo "</select>";

?>
</td>
</tr>
<tr>
<td class="label">Tuesday :</td>
<td class="field">
<?
echo "<select name='Tuesday'><option value=''></option>";
while($noticia = mysql_fetch_array($quer)) {
echo "<option value='$noticia[hours]'>$noticia[hours]</option>";
}
echo "</select>";
?>
</td>
</tr>
<tr>
<td class="label">Wednesday :</td>
<td class="field">
<?
echo "<select name='Wednesday'><option value=''></option>";
while($noticia = mysql_fetch_array($quer)) {
echo "<option value='$noticia[hours]'>$noticia[hours]</option>";
}
echo "</select>";
// etc .......
[/php]
Mar 13 '08 #1
1 1469
Hi,

If I have understood your problem clearly, you want to list the options of the third drop-down list based on the selection values made by the first two drop down lists. Please use better commenting in your code for us to understand it better.

One solution is to create a hidden field in form2 and when you reload form1, the hiddent text field in form2 should be filled with value like "form1.selectedValue"

this form variable can be posted again using 'post' method when you submit form2. So when form2 is submitted, the following two variables are submitted

1. selection from 2nd dropdown list
2. selected value from form1 (saved in the hidden field) - identified by the name of the hidden field.

see if you understand this.
Mar 19 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: mtz | last post by:
Hi there, It looks like safari has a problem with innerHTML. I have to change a dropdown depending on a selection in another dropdown. When I change the selection in the first dropdown the...
2
by: sameer | last post by:
Hi guys, thanks in advance. trying to implement some multithreading here : VS 2003 VB.net winforms I have a dropdown on a form which has list of vendors, when the user selects a vendor...
3
by: er1 | last post by:
Hi all, I have created a double dropdown list. Based on the first list selection, second list populates (this works fine). I have a submit button, which when clicked should run a select query...
0
by: bbawa1 | last post by:
Hi Phani, I have two tables. I created datasets dsPrimary and dsChild. For dsPrimary.xsd my query is For first dropdown list my query is select * from tbparent For second dataset...
4
by: mathewgk80 | last post by:
Hi everybody, I am having a drop down list with items 1,2,3.. and another dropdown list with items apple,orange and lemon.. If i select item 2 in the first dropdown list i need to get orange as...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.