473,769 Members | 1,723 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Displaying Selected Drop Down Box

769 Contributor
Hey Everyone,

Well this is probably a pretty easy question, but for some reason i just can not figure it out.

What i am trying to do is redisplay what was entered previously. I have figured everything out except for this drop down box.

Right now i am using one cfoutput query to display in the drop down box the values for it that are in the database. However, now i created a second query to display what was entered previously. The thing is i know i can't use 2 cfquery outputs around the same drop down box an so i was wondering how would i make the drop down box still have the options in the drop down box but also show what was previously selected?

here is what i have

Expand|Select|Wrap|Line Numbers
  1. this gets the values for the status
  2. <cfquery name="getstatus" datasource="CustomerSupport">
  3. usp_CS_getTicketStatuses
  4. </cfquery>
  5.  
  6. this is to display what was selected
  7. <cfquery name="ticket" datasource="CustomerSupport">
  8.         SELECT pk_ticketID,title,priority,
  9.                               status,cost_center,fk_customer_number,
  10.                               customer_company,customer_Fname,customer_Lname,
  11.                               customer_add1,customer_city,customer_state,
  12.                               customer_zip,customer_email,customer_pri_phone,
  13.                               customer_sec_phone,customer_notes,htpp 
  14.                 FROM dbo.tbl_CS_ticketMaster
  15. </cfquery>
  16.  
  17. <select name="status">
  18. <option value="" selected>Make A Selection</option
  19. >
  20. <cfoutput query="getstatus"><option value="#pk_status#"<cfif #pk_status# is #status#>selected</cfif>>#status_display#</option>
  21. </cfoutput>
  22.  
Thank you in advance,
Rach
Sep 15 '08 #1
4 8461
bonneylake
769 Contributor
solved the problem to my own question, Thank you :)
Rach
Sep 15 '08 #2
acoder
16,027 Recognized Expert Moderator MVP
Can you post the solution for the benefit of others. Thanks.
Sep 15 '08 #3
bonneylake
769 Contributor
Hey Acoder,

Here was my solution

Expand|Select|Wrap|Line Numbers
  1. <cfoutput query="ticket">
  2. <cfset status = #status#>
  3. </cfoutput>
  4. *Status<select name="status">
  5. <option value="" selected>Make A Selection</option
  6. ><cfoutput query="getstatus"><option value="#pk_status#"<cfif #pk_status# is #status#>selected</cfif>>#status_display#</option>
  7. </cfoutput>
  8. </select>
Sep 16 '08 #4
acoder
16,027 Recognized Expert Moderator MVP
Thanks for posting the solution. You could also use #ticket.status# .
Sep 16 '08 #5

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

Similar topics

1
1872
by: Laphan | last post by:
Hi All Sorry for the confusing subject, but I'm hoping that you will be able to help. In very basic terms I want to emulate a <SELECT> HTML box in VB. All I want to do is display a title name in the drop-down list, but the actual value I use would be something else.
4
6315
by: Dan | last post by:
Can anyone offer suggestions on how to do this or if it is possible? I have a form that uses a drop down box and 2 text fields. What I am trying to do is have the value of each text box set by the choice from the drop down box. Something like: <form name="populatefrm" id="contactfrm" method="post"
3
2996
by: John Walker | last post by:
Hi, On an ASP.NET page I have a drop down list control. When the user pulls down the list and makes a selection, I perform validation, and if the validation fails I want the selected item in the drop down box to go back to what the value was before the user tried to change it, but at that point I will not know what the original value was. Or is there a drop down control "revert" method, or is there any way of knowing what the original...
5
3965
by: tsunet | last post by:
HI.. I wana display that, initially in a one drop down control there will be some values. Initially, 2nd drop down control will be disabled. if user selects 1st drop down then and then only value which user has selected in 1st drop down control will be displayed in 2nd drop down control. The values can be selected randomly. Plz tell me.
1
1658
by: tsunethere | last post by:
hi .. I have 2 drop-down boxes. at first when web page will get load value this drop-down value will be"---" in this fashion. and 2nd drop-down will be disabled. unless and until user selects item from 1st drop-down 2nd will be disabled. As soon as user enter value in 1st drop-down, 2nd will get enabled and user can select value in 2nd drop-down!I want to do it server side with perl only. I want to do like this : if (value in drop-down1...
3
7359
by: penny111 | last post by:
Hi there, For my application, i need to have 3 drop down lists 1. drop down list of folder names 2. drop down list of documents in the folder selected 3. drop down list of instances of the document selected (my application uses the BusinessObjects Java Web Services SDK) The 2nd list is dependent on the 1st, while the 3rd list is dependent on the 2nd. In other words, this is what i want my application to do -select a folder from the...
8
7556
by: bimeldip | last post by:
Hi, i would like to display the list of tables in a database in a drop down list then when user selects a table, the table will be dispalyed on the page. So far i've done this: <? $dbname = 'mysql_dbname'; // Get records from database (). $sql = "show tables from $dbname"; $result=mysql_query($sql);
7
1713
Chrisjc
by: Chrisjc | last post by:
have one page that has a drop down menu, once the user selects the desired option it will then pass the selected value to a 2nd drop down. Once they select there next option I pass that value... Now I would like to hold the 2nd selected value have it search the database find all that match the selected and then only display what matches it in the corresponding ROWS in the database. I was hoping to get some help with an array because I...
15
23295
by: ajos | last post by:
Hello all, Im making a dependent drop down for my application for filtering purpose. I have populated the drop down from the database and retrieved in the html. <tr> <td valign="top" width="138" height="26"><small><font face="Verdana"><strong>Branch</strong></font></small></td> <td width="379" height="26"> <select name="branch" size="1" onChange="messValue()"> <option value="">(select branch)</option> <% ...
0
9589
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10045
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
9994
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
8870
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
7408
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
6673
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();...
0
5298
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3561
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.