|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
cfForm binding text field, visible to checkbox
Author: Paul Ihrig
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:55888#303805
ok...
i can bind from the cftextarea...
but why cant i Len the chars?
<cfinput type="text" bind="LEN({descLong.text})" name="word_count"
id="word_count" style="border:0px;" size="50" width="300" height="40">
Characters remaining<br />
Author: Sonny Savage
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:55888#302765
Hello Paul, turns out that ActionScript has a Number() function which does
what you needed.
I've never used flash forms before, so this may seem like a silly question,
but when I display this form the first two fields are empty rather than
having the value of zero. Why is that?
<cfform format="flash" width="500">
<cfinput name="FieldOne" type="text" label="Field One" validate="float"
value="0" width="60">
<cfinput name="FieldTwo" type="text" label="Field Two" validate="float"
value="0" width="60">
<cfinput name="FieldTotal" type="text" label="Field Total"
enabled="false" bind="{Number(FieldOne.text) + Number(FieldTwo.text)}"
width="60">
</cfform>
> NM.
> just put in default value to 0
> that fixed it...
> sw33t!
Author: Paul Ihrig
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:55888#302755
NM.
just put in default value to 0
that fixed it...
sw33t!
Author: Paul Ihrig
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:55888#302754
Sonny! You rock man!!!!
thank you....
now 1 more questions....
Q1:
how do i IF it out so i dont get NAN if nothing is enterd or if only 2
fileds are enterd?
<cfinput type="text" name="ul3R_SSsp" width="50" height="18" />
<cfinput type="text" name="ul4_SSsp" width="50" height="18" />
<cfinput type="text" name="ul3r4x_SSsp" width="50" height="18" />
<cfinput type="text" name="q4_0_SSsp" width="50" height="18" />
<cfinput type="text" name="StainlessSteel_totalsp" width="50"
height="18" bind="{(ul3R_SSsp.text * 1) + (ul4_SSsp.text * 1) +
(ul3r4x_SSsp.text * 1) + (q4_0_SSsp.text * 1)}">
Side note:
you also solved my problem to count the number of check boxes checked.
as a bind in a text field.
<cfinput type="checkbox" name="ul3R_SS" height="18" />
<cfinput type="checkbox" name="ul4_SS" height="18" />
<cfinput type="checkbox" name="ul3r4x_SS" height="18" />
<cfinput type="checkbox" name="q4_0_SS" height="18" />
<cfinput type="text" name="StainlessSteel_total"
width="50" height="18"
bind="{(ul3R_SS.selected * 1) + (ul4_SS.selected * 1) +
(ul3r4x_SS.selected * 1) + (q4_0_SS.selected * 1)}" />
thanks again!
i do appreciate it.
-paul
Author: Sonny Savage
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:55888#302751
OK, it was an issue of value typing. This works:
<cfform format="flash" width="500">
<cfinput name="FieldOne" type="text" label="Field One" width="60" />
<cfinput name="FieldTwo" type="text" label="Field Two" width="60" />
<cfinput name="FieldTotal" type="text" label="Field Total"
bind="{(FieldOne.text * 1) + (FieldTwo.text * 1)}" width="60" />
</cfform>
I don't know ActionScript very well, so there may be a better way of casting
the values. The total field with show 'NaN' if the other fields are empty
or not numeric.
----- Excess quoted text cut - see Original Post for more -----
Author: Paul Ihrig
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:55888#302745
i tried that too man..
----- Excess quoted text cut - see Original Post for more -----
Author: Sonny Savage
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:55888#302743
Just a guess...
{ul3R_SSsp.text + ul4_SSsp.text + ul3r4x_SSsp.text + q4_0_SSsp.text}
----- Excess quoted text cut - see Original Post for more -----
Author: Paul Ihrig
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:55888#302742
sweet
<cfinput type="checkbox" name="vm_O" label="Others" />
<cfinput type="text" name="vm_Other" label="Please specify"
visible="{vm_O.selected}"/>
from: http://www.asfusion.com/blog/entry/binding-checkboxes-in-flash-forms
now...
how do i calculate results of text field on the fly?
<cfinput type="text" name="StainlessSteel_totalsp"
bind="{ul3R_SSsp.text}+{ul4_SSsp.text}{ul3r4x_SSsp.text}+{q4_0_SSsp.text}">
/>
that just puts + between returned results..
like 3+2+5+1
not 11
i have tried ++
'++'
Author: Paul Ihrig
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:55888#302714
have also tried
<cfinput type="checkbox" name="vm_O" label="Others" />
<cfinput type="text" name="vm_Other" label="Please specify"
visible="{vm_O.selectedItem.data != 'false'}" />
Author: Paul Ihrig
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:55888#302710
i am trying to bind a text fields viability to a checkbox.
based on if it is checked or not...
<cfinput type="checkbox" name="vm_O" label="Others" />
<cfinput type="text" name="vm_Other" label="Please specify"
visible="{vm_O.selectedData = 'True'}" />
dosnt work...
thanks
-paul
|
May 24, 2012
|
Latest Fusion Authority Articles
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||