Barry,
You have the basic bones right, but your cfoutput loop is in the wrong spot.
You only want to iterate over the option tag. so put the <cfoutput query="">
around just that part.
When adding a query param to the cfoutput, it not only evaluates cf variable
(#var#), it ALSO loops over the query, and runs all the content inside the
query for each record in the query. (Hence your 20 forms)
Now, though you still need a simple cfoutput around the form line, but not a
query loop.
<cfoutput>
<form action="Details.cfm?statecodeID=#statecodeID#" method="post">
</cfoutput>
<select name="sta" size="1">
<cfoutput query="states">
<option value="#statecodeID#">#statename#</option>
</cfoutput>
</select>
<input type="submit" value="go" name="search"/>
</form>
Does that make sense?
Jerry Milo Johnson
On Mon, Dec 20, 2010 at 3:09 PM, Barry Mcconaghey <[email protected]>wrote:
>
> Hello Group.
>
> I'm trying to display this code below on my website. I need the statecodeID
> in the form action. This code below will display 50 drop-down boxes.
>
> <cfoutput query="states">
> <form action="Details.cfm?statecodeID=#statecodeID#" method="post">
>
> <select name="sta" size="1">
>
> <option value="#statecodeID#">#statename#</option>
>
> </select>
> <input type="submit" value="go" name="search"/>
> </form>
>
> Thanks,
>
> Barry
> </cfoutput>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive:
http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:5166
Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-newbie/unsubscribe.cfm