Skip to main content
Inspiring
August 25, 2008
Question

bind with cfselect

  • August 25, 2008
  • 1 reply
  • 357 views
I need to create two drop down boxes that are dependent on each other. The first box needs to display the activities and the second should populate after the user has selected the activity from the first drop down and should display the dates. I'm running the query on the page since I need to pass a URL variable to the query. I've hardcoded the variable to test the query and it seems to run OK.

I'm definitly not setting up the bind correctly. The error message is "Element ID is undefined in "Activity" (Activity is the name of the cfselect name field). And I may actually have two problems since when I comment out the 2nd cfslect that contains the bind, I get the full list of activities and not just the disctinct ones. I've tried adding "distinct a.act_id" in the query but it doesn't display any differently.

Thanks for the help,

Here's my code:
This topic has been closed for replies.

1 reply

Inspiring
August 25, 2008
Look at your cfselect named activity. Do you see anything named "id"? I don't.
wam4Author
Inspiring
August 25, 2008
Good suggestion but still have the same problem after modifying it. I simplified the cfselect and changed it to :
<cfselect name="activity" size="4" query="justofficedata" value="act_id" display="title" >
</cfselect>
<cfselect name="date" bind="{activity:act_id}">
<option name="#activity.act_id#">#activity.date#</option>
</cfselect>

but the bind fails and the error message is still "element act_id is undefined in activity" . I've tried a number of formats on the bind section. The bind section should be the name of the cfselect name, correct?