Skip to main content
Inspiring
April 3, 2012
Question

Cfdiv bind to cfselect returning multiple values?

  • April 3, 2012
  • 1 reply
  • 1668 views

Hi there,

This is something that's bugged me for a while because I can't figure out if my understanding of what's going on is bad or if something else is going on. This is in CF8 Standard.

I have a page that lists a bunch of sports teams based on the logged-in user. You select one of those teams and then get a sub-page (cfdiv) that lets you do stuff with that team. Generally:

<cfselect name="teamID" bindonLoad="true" value="teamID" bind="cfc:component.getTeamsIWant(loggedinUser)" />

Then later on:

<cfdiv id="div1" bind="url:sub-page.cfm?teamID={teamID}">

This works great: once. The problem arises if you choose one selection and then choose another: the teamID it is passing to the cfdiv gets tacked on to the end of the previously selected teamID, so that the URL parameter starts out as:

teamID=uniqueIDOfTeam1

Then if you change your selection, it goes

teamID=uniqueIDOfTeam1,uniqueIDofTeam2

...and so on, until it finally gets so big that it exceeds the maximum length of a GET string and breaks (if you change your mind one too many times).

Is it possible to 'wipe' the existing teamID value when a new one is selected? I don't need to remember previous selections.

Thanks!

This topic has been closed for replies.

1 reply

AquitaineAuthor
Inspiring
April 11, 2012

Anybody? I'm surprised there's no information about this around the net as I can't imagine why it would be desirable behavior to pass every preivously-selected value in a <cfselect> bound to a CFC.