0
Federal Projects:
<cfselect name="AdminID" bind="cfc:folder.components.forms.getProjects()" display="ProjectName" value="AdminID" bindonload="true" />
Administrators:
<cfselect name="AdminName" bind="cfc:folder.components.forms.getAdminInfo({AdminID})" display="FullName" value="PrincipalID" />

The Code above queries a cfc and returns the results to the second cfselect. My question would be how to return the result to a cfinput box? Is that even possible.

Edited by danarashad: n/a

4
Contributors
5
Replies
6
Views
7 Years
Discussion Span
Last Post by arrgh
0

Here is an example of a cfinput bind...

<cfinput type="text" visible="no" width="0" label="Please select a forum topic" name="topic_id" bind="{data.selectedItem.topic_id}">

The code above binds to a grid called data and the selected record for column topic_id. It's only visible="no" because I use it as a hidden way to pass data to another page

Edited by peter_budo: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks)

0

If I understand you correctly, when the user selects a value in the 2nd select box, the selected value should show up in a text field. This can be done pretty quickly with your own javascripting - add an "onchange" event to the 2nd select...

<cfselect name="AdminName" bind="cfc:folder.components.forms.getAdminInfo({AdminID})" display="FullName" value="PrincipalID" 
onchange="document.getElementById('txt').value = this.options[this.selectedIndex].text;"
/>
<input name="txt" id="txt" />

note that this will populate the text field with the "Text" of the selected option - this is what is visible in the select area as opposed to the "value" of the option which is what is actually sent to the server when the form is submitted:

<option value="foo">Bar</option>

foo is the value above, while Bar is the text.

0

The Code above queries a cfc and returns the results to the second cfselect. My question would be how to return the result to a cfinput box? Is that even possible.

It doesn't make much sense to return _multiple_ results to a cfinput box. Perhaps you're thinking of something different, like an auto-suggest maybe..?

0

It doesn't make much sense to return _multiple_ results to a cfinput box. Perhaps you're thinking of something different, like an auto-suggest maybe..?

Yeah I had to end up using an auto-suggest.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.