473,394 Members | 1,932 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,394 software developers and data experts.

Need to be able to have multiple selected="selected" in a list.

I have a database with 1 to many and the many is a list with multiple
selects in a list. When I click on a master record I have as part of
my form the select statement for the multiple choice list. I want the
list to highlight the multiple chosen values. here is part of the
code.

$dresscat = specdresscat($dresstypeid); //this is the query to get the
values in the detail table
$drcatrow = pg_fetch_array($dresscat);// the array for the detail
table.
<select name="stages[]" multiple="multiple">
<?php
$allstages = allstages(); // this is a function to query my database
to get the value for the list.
while ($allstagerows=pg_fetch_array($allstages)) {
$eachstage= $allstagerows["stageid"];
$specstage= $drcatrow["stageid"]; // this is the point I need help
if ($specstage == $eachstage){ ?>
<option value=<?php echo $eachstage;?> selected="selected"><?php echo
allstagerows["stage"]?></option>
<?php }else{ ?>
<option value=<?php echo $eachstage;?>><?php echo
$allstagerows["stage"]?></option>
<?php
}
}
?>
</select>

This is the select statement I have now. I get the first falue to be
chosen but not the other values.

Jun 4 '06 #1
0 1870

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Nicklas | last post by:
Hi I need to open a folder window with a path decided by me. Eg. "C:\strangeFolder\myown". I.e. NOT a predefined folder defined by FolderId (e.g. MyDocuments, Printers etc.) I haven't managed...
4
by: charliewest | last post by:
I need to set the selected drop down list value at run time. I am aware of the method "SelectIndex" however this works only if you know the precise location of the value within the ListItem...
2
by: Nathan Sokalski | last post by:
I have several DropDownList controls on my page that use databinding. However, I want to give users the option of selecting a choice such as "None Selected" or something else that shows they did...
0
by: John Smith | last post by:
This is what I am trying to do: <asp:datagrid id="DataGrid1" runat="server" AutoGenerateColumns="False"> <Columns> <asp:BoundColumn Visible="False" DataField="id" ReadOnly="True"...
0
by: John Smith | last post by:
This is what I am trying to do: <asp:datagrid id="DataGrid1" runat="server" AutoGenerateColumns="False"> <Columns> <asp:BoundColumn Visible="False" DataField="id" ReadOnly="True"...
9
by: Tristán White | last post by:
Hi I am very new to PHP - actually, this is my second day at it, as I've only recently started a new job last week. We're a charity. I have a "No input file selected" problem. A Google search...
1
by: ASF | last post by:
Is it possible to create a crystal report graph in which a user selects some parameters---a date range for instance--- AND the table field that they wish to "Group By" then hits the submit button...
1
by: Jenny | last post by:
Dear all, I have one select which lists one visible element. I want this select can show scrollbar after I click its down arrow, so that i can use the scrollbar to select the element i want. ...
2
by: alexandis | last post by:
I have menu bound to sitemap file. This is a piece of code <asp:menu ... > <StaticItemTemplate> <%# ((MenuItem)Container.DataItem).Selected ? : %> </StaticItemTemplate> </asp:menu> I check...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.