This is correct. You were making 50 selects because it was within the loop.

Also, it's a good practice to specify variables.

<cfoutput>
<form action="Details.cfm" method="post">
   <select name="sta">
       <cfloop query="states">
       <option value="#states.statecodeID#">#states.statename#</option>
       </cfloop>
   </select>
   <input type="submit" value="go" name="search"/>
</form>
</cfoutput>

Not REQUIRED, but helpful when it gets more complex and it's a good
thing to get in the habbit of.

On Mon, Dec 20, 2010 at 12:27 PM, Eric Nicholas Sweeney
<[email protected]> wrote:
>
> Try this:
>
> <cfoutput>
> <form action="Details.cfm" method="post">
>    <select name="sta">
>        <cfloop query=" states ">
>        <option value="#statecodeID#">#statename#</option>
>        </cfloop>
>    </select>
>    <input type="submit" value="go" name="search"/>
> </form>
> </cfoutput>
>
>
> And on Details.cfm search for FORM.sta
>
> Like:
>
> <cfif IsDefined("FORM.sta") AND FORM.sta NEQ "">
>
> <!--- Do Something Cool! --->
>
> </cfif>
>
> I think that is what you are trying to do - one select box with all the
> states - yes?
>
> - Nick
>
>
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:5165
Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-newbie/unsubscribe.cfm

Reply via email to