Ask a Question related to Macromedia ColdFusion, Design and Development.
-
Bagger Vance #1
Cannot put <cfoutput> around a <select> statement usinga query.
<select name="t#this_tourn#_course_id">
<cfoutput query="get_courses">
<option value="#course_id#"> #course_name# - Par #par#</option>
</select>
Obviously, the variable 't#this_tourn#_course_id' in the <select> statement is
not getting processed because it is not enclosed in <cfoutput> tags. Since I'm
using a query for the OPTION, I don't know how to make this work. As far as I
know, I can't use a CFSELECT because it will only display one column.
There must be a fairly simple solution to this, but I am at a loss.
Thanks.
Bagger Vance Guest
-
question about SQL query and cfoutput with INNER JOIN
I have a query that pulls data from two related tables (an Article Table and a Photo table, linked by ArticleID) Lets say i have 3 photos that are... -
CFOUTPUT QUERY rowcount = 0
Hello, I have a query which return 0 row. I have a CFOUTPUT QUERY which try to output my query. Coldfudion enter in the CFOUTPUT once EVEN if my... -
Using cfoutput within a cfif statement
I am trying to setup a form validation, what i need to do is look at the Specimen Number entered and compare it against the database to see if it... -
<cfoutput query> and TABLE formatting
HI, I'm trying to output images from a database using <cfoutput query>. That part works fine. But the images display all in one column, one... -
SELECT statement
I have 3 tables: table countryPrice: productID countryId price 1 Italy 90 1 England ... -
KevinOtt #2
Re: Cannot put <cfoutput> around a <select> statementusing a query.
Is there any reason <cfoutput<select name="t#this_tourn#_course_id"></cfoutput> wouldn't work?
KevinOtt Guest
-
Bagger Vance #3
Re: Cannot put <cfoutput> around a <select> statementusing a query.
Well, son of a gun - that works. I didn't think you could split tags up like
this, so I didn't even try it:
<cfoutput> <select> </cfoutput> </select>
I thought I would get a message about an ending </select> tage must have a
matching start tag, but I guess that's only for ColdFusion Tags.
Thanks!
Bagger Vance Guest
-
Stressed_Simon #4
Re: Cannot put <cfoutput> around a <select> statementusing a query.
While that does work it is still bad coding practice to incorrectly nest tags.
You should do either:-
<select name="<cfoutput>t#this_tourn#_course_id</cfoutput>">
<cfoutput query="get_courses">
<option value="#course_id#"> #course_name# - Par #par#</option>
</cfoutput>
</select>
or
<cfoutput>
<select name="t#this_tourn#_course_id">
<cfloop query="get_courses">
<option value="#course_id#"> #course_name# - Par #par#</option>
</cfloop>
</select>
</cfoutput>
Stressed_Simon Guest
-
Adam Cameron #5
Re: Cannot put <cfoutput> around a <select> statement using a query.
> While that does work it is still bad coding practice to incorrectly nest tags.
No, it's not because HTML is "noise" to CFML, it's not code.
If there was a bad practice to be had regarding "nesting" HTML and CFML> <select name="<cfoutput>t#this_tourn#_course_id</cfoutput>">
tags, this would be an example of it, I reckon.
Embedding tags within one another surely is far worse than "incorrectly"
nesting them?
Yeah. This is what I'd do.> <cfoutput>
> <select name="t#this_tourn#_course_id">
> <cfloop query="get_courses">
> <option value="#course_id#"> #course_name# - Par #par#</option>
> </cfloop>
> </select>
> </cfoutput>
Adam Cameron Guest



Reply With Quote

