Ask a Question related to Coldfusion Database Access, Design and Development.
-
ThomasWood #1
Populating SELECTED of CFSELECT with different query
I am trying to populate a CFSELECT from a query (which is working fine), but I
want the SELECTED value to come from a
different query. The values are identical because the second table is
populated with values from the first table on a seperate page. Is there anyway
to do this? Basically this is what I want to do
<cfquery name="query1">
SELECT * FROM Table1
</cfquery>
<cfquery name="query2">
SELECT * FROM Table1
WHERE Name = '#query1.Name#'
</cfquery>
<cfselect query="table1" display="Name" value="Name" selected="#query2.Name#">
I know that you cannot use multiple queries, but I know there must be a way to
do this, but I can't think of how.
ThomasWood Guest
-
how do you populate cfselect when cfgrid selected row ischanged
hi can anyone enlighten me as to how to pass data to a cfselect from a cfgrid i am using a listner function so that the grid can populate form... -
Specifically Referencing and Populating a CFSELECT Datafield
QUESTION ..... How do I get the CFSELECT (CRITS) to populate the data component as well as the labelField component. There must be a path ... -
selected= not working in cfselect
I am working on my admin interface for a department and I need to have a cfselect actually hilight the value that is passed from a query (like it is... -
CFSELECT problem with Selected attribute
Hello, I've found that if I have a simple CFSELECT statement using a query like the following: <CFSELECT Name="Field1" Size=1 Query="Names"... -
item selected cfselect with cfgrid
If anyone's found a better way to make an item selected in a cfselect using cfgrid that the following, let me know: <cfgrid name="AddressGrid"... -
ThomasWood #2
Re: Populating SELECTED of CFSELECT with different query
Took care of it like this
<cfselect name="selectname">
<cfloop query="query1">
<cfif query1.tablename EQ query2.tablename>
<option Value="<cfoutput>#query2.name#</cfoutput>"
selected><cfoutput>#Name#</cfoutput></option>
<cfelse>
<option
Value="<cfoutput>#query2.name#</cfoutput>"><cfoutput>#Name#</cfoutput></option>
</cfif>
</cfloop>
</cfselect>
ThomasWood Guest



Reply With Quote

