August 28, 2008
For ColdFusion hosting try HostMySite.com. |
Home /
Groups /
ColdFusion Talk (CF-Talk)
cfForm binding text field, visible to checkbox
i am trying to bind a text fields viability to a checkbox.Paul Ihrig 04/04/08 09:51 A have also triedPaul Ihrig 04/04/08 09:56 A sweetPaul Ihrig 04/04/08 01:37 P Just a guess...Sonny Savage 04/04/08 01:44 P i tried that too man..Paul Ihrig 04/04/08 01:47 P OK, it was an issue of value typing. This works:Sonny Savage 04/04/08 02:35 P Sonny! You rock man!!!!Paul Ihrig 04/04/08 03:08 P NM.Paul Ihrig 04/04/08 03:09 P Hello Paul, turns out that ActionScript has a Number() function which doesSonny Savage 04/04/08 04:54 P ok...Paul Ihrig 04/19/08 01:55 P 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 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'}" /> 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 ++ '++' Just a guess... {ul3R_SSsp.text + ul4_SSsp.text + ul3r4x_SSsp.text + q4_0_SSsp.text} On Fri, Apr 4, 2008 at 1:37 PM, Paul Ihrig <pihrig@gmail.com> wrote: ----- Excess quoted text cut - see Original Post for more ----- i tried that too man.. On Fri, Apr 4, 2008 at 1:44 PM, Sonny Savage <sonnysavage@gmail.com> wrote: ----- Excess quoted text cut - see Original Post for more ----- 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. On Fri, Apr 4, 2008 at 1:47 PM, Paul Ihrig <pihrig@gmail.com> wrote: ----- Excess quoted text cut - see Original Post for more ----- 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 NM. just put in default value to 0 that fixed it... sw33t! 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> On Fri, Apr 4, 2008 at 3:08 PM, Paul Ihrig <pihrig@gmail.com> wrote: > NM. > just put in default value to 0 > that fixed it... > sw33t! 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 />
|
Mailing Lists
|
Latest Fusion Authority Articles
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||