>- see footer for list info -< Hi Stephen Just out of interest, any benefit of using structkeyexists() over isdefined() on cfmx?
thanks mark -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Stephen Moretti (cfmaster) Sent: 24 November 2004 16:19 To: Coldfusion Development Subject: Re: [CF-Dev] Best way to check if a form field is empty >- see footer for list info -< Stephen Adams wrote: >>In your experience, what is the best way to check whether a form field >>has been completed, both a text field and a checkbox. >> >>Is it better to try <cfif LEN(FORM.formfield)> >>or <cfif LEN(FORM.formfield) EQ 0>? >> >> If I remember correctly, there was a performance check done in CFDJ aaaaaaaaggggggggessss ago on this particular issue. And, again, if I remember correctly using len(varname) as a boolean check rather than a value check is marginally faster, but its the kind of faster where you have to do 100s of thousands of tests to see milliseconds in the speed difference. When I'm feeling lazy and it doesn't matter about code readability I use the boolean version. Otherwise, I always use the readable version of "len(varname) eq x" >>And what about checkboxes? >> >> You need to check to see if they exist (cf5 - isDefined("") | cfmx - StructKeyExists() ). No checked checkbox, no checkbox_var and value in the form scope. >>I don't want to use JavaScript, I hate it, grrrrrrrrrrrrrrrrrrrrr! >> >> Nowt wrong with javascript. Stephen _______________________________________________ For details on ALL mailing lists and for joining or leaving lists, go to http://list.cfdeveloper.co.uk/mailman/listinfo -- CFDeveloper Sponsors:- >- Hosting provided by www.cfmxhosting.co.uk -< >- Forum provided by www.fusetalk.com -< >- DHTML Menus provided by www.APYCOM.com -< >- Lists hosted by www.Gradwell.com -< >- CFdeveloper is run by Russ Michaels, feel free to volunteer your help >-< _______________________________________________ For details on ALL mailing lists and for joining or leaving lists, go to http://list.cfdeveloper.co.uk/mailman/listinfo -- CFDeveloper Sponsors:- >- Hosting provided by www.cfmxhosting.co.uk -< >- Forum provided by www.fusetalk.com -< >- DHTML Menus provided by www.APYCOM.com -< >- Lists hosted by www.Gradwell.com -< >- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<
