CFINPUT Binding


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.

I dont think you can bind to an <input>. It does not have the bind attribute.

You can use:

<cfdiv name=“somename” bind=“{AdminId}”></cfdiv>

Not sure if that helped… :confused:

IF you are merely trying to populate a form input based on a query, I use simple javascript after running the query to update the value in a cfinput.



<cfquery name="q" datasource="_dsn">
select id from tablename
where ....
and rownum = 1
</cfquery>

<script language="javascript">
document.formname.fieldname.value = <cfoutput>#q.id#</cfoutput>
</script>



<cfform name="formname" ...>
<cfinput name="fieldname" value="">
...
</cfform>

You can separate the components into their own CFMs/CFCs but this should get you something to work with.

Thanks for the advice. I used the following and it worked. I have CF8.


<cfinput name="somename" rows="15"  cols="50" bind="{AdminID}" disabled="disabled" />

Awsome, glad that work… now I know you can bind to a cfinput… :blush: