bind with cfselect

This is a discussion on bind with cfselect within the Cold Fusion forums in Application Servers & Tools category; 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 ...

Go Back   Application Development Forum > Application Servers & Tools > Cold Fusion

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-25-2008, 11:01 AM
wam4
Guest
 
Default bind with cfselect

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:


<cfquery datasource="dsn" name="justofficedata">
Select a.act_id, convert(varchar,a.date,101) as date,b.title,a.id
From km_work a, km_activities b
Where a.office_id = '#URL.variable#'
and a.act_id = b.id
order by a.id
</cfquery>

<cfoutput>
<cfform name="test" action="testform.cfm" method="post">
<cfselect name="activity" size="4">
<cfloop query="justofficedata">
<option value = "#act_id#">#act_id# #title#</option>
</cfloop>
</cfselect>

<cfselect name="date" bind="{activity}">
<option name="#activity.id#">#activity.date#</option>
</cfselect>



</cfform>
</cfoutput>

Reply With Quote
  #2  
Old 08-25-2008, 12:44 PM
Dan Bracuk
Guest
 
Default Re: bind with cfselect

Look at your cfselect named activity. Do you see anything named "id"? I don't.
Reply With Quote
  #3  
Old 08-25-2008, 01:18 PM
wam4
Guest
 
Default Re: bind with cfselect

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?

Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 06:04 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.