Advertisement

02.26.2008 at 11:40AM PST, ID: 23194761
[x]
Attachment Details

working with drop down list box to change contents of label

Asked by sonicimpulse in Cold Fusion Markup Language, WebApplications

Thanks to all the generous people on here help me out. I have this section of code I want to modify. This code changes the contents of a label depending on whats selected in a listbox.  What I want to do is modify it to populate the list box from  a database instead of the array.  I will attach both the code I got from here and the code I use to populate a list box from a database. Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
<!--- This is the code that changes the contents of a list box --->
<cfset mySel = queryNew("")>
<cfset queryAddColumn(mySel, "label", listToArray("test,Option2,Option3,Option4,Option5"))>
<cfset queryAddColumn(mySel, "selval", listToArray("O1,O2,O3,O4,O5"))>
<cfset queryAddColumn(mySel, "description", listToArray("Description for Option1;Description for Option2;Description for Option3;Description for Option4;Description for Option5",";"))>
<form>
<select name="mySelect" onChange="showDesc(this)" >
<option descript="Select one Option.">-Select-</option>
<cfoutput query="mySel">
  <option value="#selval#" descript="#description#" >#label#</option>
</cfoutput>
</select>
<span id="description">Select one Option.</span>
</form>
<script>
function showDesc(theSel){
 var theDesc = theSel.options[theSel.selectedIndex].getAttribute("descript");
 document.getElementById("description").innerHTML = theDesc;
}
</script>
 
 
<!--- This is the code I use to populate a list box from a database --->
<tr>
  <td>Catagory:</td>
  <td>  <cfquery name="cata" datasource="#DSN#">
SELECT id,catagory from catagories
</cfquery>
<select name="lcatagory">
<cfoutput query="cata">
<option value="#id#|#catagory#">#catagory#</option>
</cfoutput>
</select></td>
</tr>
 
 
[+][-]02.26.2008 at 11:46AM PST, ID: 20987973

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]02.26.2008 at 11:47AM PST, ID: 20987982

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.26.2008 at 11:47AM PST, ID: 20987986

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.26.2008 at 11:57AM PST, ID: 20988097

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.26.2008 at 12:00PM PST, ID: 20988127

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.26.2008 at 12:03PM PST, ID: 20988153

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.26.2008 at 12:04PM PST, ID: 20988162

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.26.2008 at 12:05PM PST, ID: 20988173

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.26.2008 at 12:06PM PST, ID: 20988184

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.26.2008 at 12:08PM PST, ID: 20988203

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.26.2008 at 12:09PM PST, ID: 20988225

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.26.2008 at 12:09PM PST, ID: 20988228

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.26.2008 at 12:10PM PST, ID: 20988237

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.26.2008 at 12:19PM PST, ID: 20988337

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.26.2008 at 12:20PM PST, ID: 20988348

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.26.2008 at 12:21PM PST, ID: 20988354

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]02.26.2008 at 02:01PM PST, ID: 20989424

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.26.2008 at 02:07PM PST, ID: 20989476

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.26.2008 at 02:07PM PST, ID: 20989480

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.26.2008 at 03:04PM PST, ID: 20989922

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]02.26.2008 at 03:19PM PST, ID: 20990009

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.26.2008 at 03:22PM PST, ID: 20990023

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.26.2008 at 03:29PM PST, ID: 20990075

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.26.2008 at 03:47PM PST, ID: 20990154

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.26.2008 at 04:41PM PST, ID: 20990406

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.26.2008 at 10:28PM PST, ID: 20991826

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.27.2008 at 06:31AM PST, ID: 20994213

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.27.2008 at 09:26AM PST, ID: 20996033

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.27.2008 at 07:17PM PST, ID: 21000941

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.27.2008 at 07:47PM PST, ID: 21001078

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Cold Fusion Markup Language, WebApplications
Sign Up Now!
Solution Provided By: _agx_
Participating Experts: 2
Solution Grade: A
 
 
[+][-]02.28.2008 at 08:44AM PST, ID: 21005618

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628