Guest_imported
New member
- Jan 1, 1970
- 0
Hi Folks,
I'm new to ColdFusion, and i'm looking for some help on selecting a default value for a dynamic select box.
I have populated a select box with a query. The drop down lists displays a list of IDs. I have another query which selects one of these IDs. I want the drop down box to default to the selected ID.
this is the code i tried, which success. it always defaulted to the first row of the query
<SELECT name="courseid">
<CFOUTPUT query="getcourses">
<OPTION value="#getstudentdetails.courseid#">#getcourses.courseid#
</CFOUTPUT>
</SELECT>
getcourse is the list of IDs. getstudentdetails is the query which returns just one ID. Am I close?
Regards,
Peter
I'm new to ColdFusion, and i'm looking for some help on selecting a default value for a dynamic select box.
I have populated a select box with a query. The drop down lists displays a list of IDs. I have another query which selects one of these IDs. I want the drop down box to default to the selected ID.
this is the code i tried, which success. it always defaulted to the first row of the query
<SELECT name="courseid">
<CFOUTPUT query="getcourses">
<OPTION value="#getstudentdetails.courseid#">#getcourses.courseid#
</CFOUTPUT>
</SELECT>
getcourse is the list of IDs. getstudentdetails is the query which returns just one ID. Am I close?
Regards,
Peter