?
Solved

cfselect cfinput can I bind the displayed text?

Posted on 2011-02-24
3
Medium Priority
?
715 Views
Last Modified: 2015-02-12
I need to bind not only the value of the cfselect to a cfinput (which works just fine) but also the displayed text from the cfselect.  I need to end up with the id from the cfselect in one cfinput and the associated name that is displayed in the cfselect as the value of the second cfinput.  The results of the second cfinput is "null" as it stands now.

My cfselect:---------------------------------------
<cfloop query="QContactTypes">
<cfoutput>
<td>#QContactTypes.description# Contacts:</td>
<td><cfselect bind="cfc:globalcfc.basic.getcontacts(compid={compGrid.id},specialty=#QContactTypes.acronym#)" name="#QContactTypes.acronym#" display="contactname" selected="contactname" value="id" bindonload="false" size="10"></cfselect>
</td>
</cfoutput>
</cfloop>


My cfinputs:-------------------------------------------------------------
<cfloop query="QContactTypes">
<tr>
<cfoutput>
<td align="right">#QContactTypes.description#:</td>
<td><cfinput type="text" name="#QContactTypes.acronym#ID" bind="{#QContactTypes.acronym#@change}" />
<cfinput type="text" name="#QContactTypes.acronym#name" bind="{#QContactTypes.acronym#.selectedItem}" /></td>
</cfoutput>
</tr>
</cfloop>
0
Comment
Question by:lantervj
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 

Accepted Solution

by:
lantervj earned 0 total points
ID: 34977464
I changed the cfinputs to bind on the .value and .text of the cfselect.  This worksjust fine.

<td><cfinput type="text" name="#QContactTypes.acronym#ID" bind="{#QContactTypes.acronym#.value}" />
<cfinput type="text" name="#QContactTypes.acronym#name" bind="{#QContactTypes.acronym#.text}" /></td>
0
 
LVL 29

Expert Comment

by:Pravin Asar
ID: 40606371
<cfset qData = QueryNew ("value,display","varChar,varchar" )/>
<cfset t = QueryAddRow(qData)/>
<cfset t = QuerySetCell(qData,"value","no")>
<cfset t = QuerySetCell(qData,"display","No")>
<cfset t = QueryAddRow(qData)/>
<cfset t = QuerySetCell(qData,"value","yes")>
<cfset t = QuerySetCell(qData,"display","Yes")>

<cfset user_is_admin = "yes">

<cfform name="f1">
      <cfselect name="sel1" value="value" display="display" query="qData" selected="#user_is_admin#" queryPosition="below">
            <option value="">Select Option</option>
      </cfselect>
      <cfinput type="text" name="field1"  bind="{sel1.value}">
</cfform>
0
 
LVL 29

Expert Comment

by:Pravin Asar
ID: 40606373
I did not realized you closed. Sorry
0

Featured Post

More Than Just A Video Library

Train for your certification. Learn the latest DevOps tools. Grow your skillset to do better work.

At Linux Academy, we release new training modules every week so you'll always be up to date on the latest tech.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

CFGRID Custom Functionality Series -  Part 1 Hi Guys, I was once asked how it is possible to to add a hyperlink in the cfgrid and open the window to show the data. Now this is quite simple, I have to use the EXT JS library for this and I achiev…
I spent nearly three days trying to figure out how incorporate OAuth in Coldfusion for the Eventful API. Hopefully, this article will allow Coldfusion Programmers to buzz through the API when they need to. Basically, what this script does is authori…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question