473,606 Members | 2,110 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need to be able to have multiple selected="selec ted" 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($d resstypeid); //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="multi ple">
<?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="selec ted"><?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 1884

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

Similar topics

0
1123
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 to find a way to do this using the "FolderBrowser class" I' we also tried to go by the shell methods but haven't found anything yet. Might be that I haven't investigated the methods properly but I do need the help..
4
37456
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 collection. Otherwise, what is the recommended approach? I have managed to set the appropriate value using the following loop: for (int i = 1; i < ddlUsers.Items.Count; i++) { if (ddlUsers.Items.ToString() == sUserId)
2
1705
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 not make a selection. However, if I attempt to add a ListItem to the Items collection when databinding is used it is removed and replaced by the item in the databinding source. Is there any simple way to add an extra ListItem, or do I have to build...
0
2284
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" HeaderText="ID"></asp:BoundColumn> <asp:TemplateColumn HeaderText="O"> <ItemTemplate> <asp:DropDownList id="cmbObdelaj" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DropDown_SelectedIndexChanged">
0
3320
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" HeaderText="ID"></asp:BoundColumn> <asp:TemplateColumn HeaderText="O"> <ItemTemplate> <asp:DropDownList id="cmbObdelaj" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DropDown_SelectedIndexChanged">
9
4833
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 has shown me that this is a common problem, but I have tried to follow all the various instructions but none of them make any difference. First of all... Some background on the page it links from.....
1
1668
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 and CR displays the graph on the webpage *Grouped By* the user's selection? In SQL terms, I'm trying to place a parameter in the Group By section of a select statement. Only problem is that CR in VS 2005 seems to want to establish the Grouping...
1
5325
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. I test it on windows IE. The scrollbar will be shown when the select has more than 30 elements, otherwise it won't show scrollbar. I don't want the list to be that long. I hope that the scrollbar can be shown when the number of elements is 8.
2
1989
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 properties of menu items in my method and based on it decide, which element should be shown selected.
0
8428
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8078
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8299
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6753
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5962
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5456
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2442
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1548
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1285
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.