Solved

cfselect cfinput can I bind the displayed text?

Posted on 2011-02-24
3
699 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
  • 2
3 Comments
 

Accepted Solution

by:
lantervj earned 0 total points
Comment Utility
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 28

Expert Comment

by:Pravin Asar
Comment Utility
<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 28

Expert Comment

by:Pravin Asar
Comment Utility
I did not realized you closed. Sorry
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Hi, Even though I have created this Tutorial on My personal Blog, Some people might not able to find my website, So here i am posting it again Today, from the topic it is very clear that i will be showing you here the very basic usage of how we …
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

763 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now