Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
CF_N_Montreal #1
Bind Attribute in CheckBox -->Help
Hello Everyone,
I attented a great presentation yesterday by Macromedia Canada.
I need a little help regarding the BIND attribute.
I am doing a query from two seperate tables.
The first query retrieves all the user names.
The second query searches for language for each user depending on the user_id.
Attached Code:
<cfquery name="GetUsers" datasource="DSN1">
SELECT userid, user_name
FROM UsersTable
Order By user_name
</cfquery>
<cfquery name="GetLanguage" datasource="DSN2">
SELECT Language
FROM LanguageTable
Where user_id = GetUsers.userid
</cfquery>
<cfform method="post" action="Action.cfm" format="flash" skin="halosilver"
preserveData="yes">
<cfgrid name="UserGrid" query="GetUsers" rowheaders="no">
<cfgridcolumn name="user_name" header="First Name" dataalign="center">
</cfgrid>
<cfinput type="text" name="firstname" label="Name:"
bind="{UserGrid.dataProvider[UserGrid.selectedIndex]['user_name']}">
<cfinput type="checkbox" name="LangEnglish" bind=""> (If the language is
English then put it to checked = "yes")
<cfinput type="checkbox" name="LangFrench" bind=""> (If the language is
French then put it to checked="yes")
<cfinput type="submit" name="btn" value="Save Data">
</cfform>
Thanks in advance guys.
CF_N_Montreal Guest
-
bind to a checkbox
I have a tabbed flash form. the final tab is a summary page of the previous two tabbed pages. The second page lists 10 check boxes. If the... -
Bind a textfield with a checkbox
Hi all, is it possible to bind a textfield with a checkbox. What I am trying to do is, if the checkbox is selected todays date will display in the... -
Howto bind CheckBox to the datagrid/ Then update the database field when the checkbox is clicked.
I am trying to update the database field when the checkbox is clicked. I am trying to modified the following solution but.. got stuck on the... -
How to bind checkbox to one of the values of a datagrid
Hello All, I hope someone can enlighten me, all of the examples and posts Ihave read and sifted through doesn't pertain to what i wouldlike to do... -
how to bind data to checkbox in datagrid
hi i have a datagrid and one colume is a bool if i use a normal asp:BoundColumn is shows as true or false and i want it to show as a checkbox but... -
SharedDynamics #2
Re: Bind Attribute in CheckBox -->Help
Also having a similar problem with checkboxes and cfselect using the html option.
SharedDynamics Guest
-
CF_N_Montreal #3
Re: Bind Attribute in CheckBox -->Help
SharedDynamics: Did you find any solutions yet?
CF_N_Montreal Guest
-
SharedDynamics #4
Re: Bind Attribute in CheckBox -->Help
Nothing yet, I found something about how to default your select dropdown box
to the value from a query with the bind attribute. But I can't get that to
work either.
I'm frustrated at myself for spending 7 years on CFML and 0 years on
actionscript.
SharedDynamics Guest
-
drforbin1970 #5
Re: Bind Attribute in CheckBox -->Help
Here's the answer with 'English' substituted for your grid value:
<cfinput type="text" name="firstname" label="Name:" value="English">
<cfinput type="checkbox" name="LangEnglish"
visible="{(firstname.text=='English') ? (LangEnglish.selected=true,true) :
(LangEnglish.selected=false,true)}">
<cfinput type="checkbox" name="LangFrench"
visible="{(firstname.text=='French') ? (LangFrench.selected=true,true) :
(LangFrench.selected=false,true)}">
Uses the visible value to run the ActionScript.
(LangEnglish.selected=true,true) sets the checkbox to true and then sets the
visible attribute to true so the checkbox does not disappear. Notice both
conditions have the ' ,true' to make sure the checkbox stays visible.
Hope this helps.
drforbin1970 Guest



Reply With Quote

