albert_leung Posted March 15, 2006 Share Posted March 15, 2006 Hi All. This is urgent. I am using Coldfusion to create the homepage. I want to retrieve the items from Database and those items are become my drop box for user select and send the selected item to another page. Could someone can help me how to write the HTML code or using other language with Coldfusion? I am a new guy for using HTML and Coldfusion. Thanks a lotAlbert Link to comment Share on other sites More sharing options...
Skemcin Posted March 16, 2006 Share Posted March 16, 2006 <cfquery name="qryGetMyStuff" datasource="mydsn">SELECT *FROM mytablenameWHERE xxxx LIKE 'yyyyyy'</cfquery><cfform action="destinationpage.cfm" method="post">...<cfselect name="myoptions"><option value="">-- select one --<cfoutput query="qryGetMyStuff"><option value="field_key_value">field_display_name</cfoutput></cfselect>...</cfform> Link to comment Share on other sites More sharing options...
albert_leung Posted March 16, 2006 Author Share Posted March 16, 2006 Thank you for your help. What if I want to load the data from the database and show it to the drop box automatically? Since I have many records and I would like to list one attribute in the drop box. For example, I would like to let the user choose the name of the animal and I retrieve the name from my database and show it to the drop box. Thank you so much.Regards <cfquery name="qryGetMyStuff" datasource="mydsn">SELECT *FROM mytablenameWHERE xxxx LIKE 'yyyyyy'</cfquery><cfform action="destinationpage.cfm" method="post">...<cfselect name="myoptions"><option value="">-- select one --<cfoutput query="qryGetMyStuff"><option value="field_key_value">field_display_name</cfoutput></cfselect>...</cfform><{POST_SNAPBACK}> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now