Skip to main content
Inspiring
September 16, 2009
Question

how do u bind many cfinput texts to 1 cfselect bind?

  • September 16, 2009
  • 2 replies
  • 1047 views

Greetings-

I have been enjoying linking multiple cfselects together via binding and now need to do the following:

~ Give the user a query populated cfselect, let them make a selection

~ Populate a second cfselect (no problem with that, I just bind to a cfc and pass it the value from the first cfselect) but the problem is I also need to  populate numerous cfinput type="text" fields, hopefully from the same binding call. I read into the docs and I'm clearly still missing something.

I've been using a typical 2d array with the query results id and value respectively to return to the binding call.... does anyone know if I can simply add additional elements to the array (currently I'm only at arrayvalue[1] and arrayvalue[2]; i could (and would like to) simply build out my binding's query to include all of the data I need for the remaining cfinputs like so:  arrayvalue[3], arrayvalue[4], arrayvalue[5].

Am I over thinking this and making it more difficult than it needs to be?

The final result I'm looking for will give the user details about a specific product (via the cfinput type=text) after they select the original cfselect and then they can drill down to specific products using the second cfselect.

original cfselect (currently working)

second cfselect, populated via a binding call passing it the selected value from the original cfselect (currently working)

number one cfinput type="text".... populated with a value from the binding call from the second cfselect (currently not working)

number two cfinput type="text".... populated with a different value from the binding call from the second cfselect  (currently not working)

number three cfinput type="text".... populated with yet a different value from the binding call from the second cfselect  (currently not working)

Thanks in advance,

Rich

This topic has been closed for replies.

2 replies

Inspiring
October 2, 2009

It would probably be easier if, instead of binding, you invoked the function and used the query it returned in your variable.  You can then use toScript() or cfwddx to send the data to javascript and figure it out from there.

October 2, 2009

Use <input />s instead of <CFinput />s and update inputs values in your JavaScript...

or use one hidden <cfinput /> bound with the value of your second <cfselect /> to get ALL required values for ALL inputs and use JavaScript to populate them...

Inspiring
October 2, 2009

Thanks for your response, I'll give it a try and let you know how it goes.

Rich