> <cfif (isDefined("form.service" & i)) AND (evaluate("form.service" & i)
NEQ "")>
> <cfset tempValue = form["service" & i]>
form["service" & i] NEQ ""
or just
len(form["service" & i])
should be a little faster than (evaluate("form.service" & i) NEQ "") on
that many records
<cfif isDefined("form.service" & i) AND form["service" & i] NEQ "">
<cfset tempValue = form["service" & i]>
----- Original Message -----
From: "Les Mizzell" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Wednesday, March 05, 2003 8:35 PM
Subject: RE: cfloop/index question
> Here's what finally worked:
>
> Please send me more information on the following services:
>
> <cfloop from="100" to="800" step="10" index="i">
> <cfif (isDefined("form.service" & i)) AND (evaluate("form.service" & i)
> NEQ "")>
> <cfset tempValue = form["service" & i]>
> #tempValue# <br>
> </cfif>
> </cfloop>
>
> The reason each checkbox has a unique name (service + number) is so the
form
> can "autocheck" a particular service. Let's say a customer is on the
> "Fluorescent Bulb Disposal" page and hits the "Send Me More Info" button.
> The form comes up with "Fluorescent Bulb Disposal" (service 370) already
> checked. They can then look over the list and see if they want information
> on anything else while they're at it.
>
> I could use the service value as the checkbox value, but then I'd have to
> build a lookup table with 80 services listed to see what names to put on
the
> response email that went out. The client that owns the site doesn't have
> code numbers or anything for the services, I assigned those. Client only
> goes by the Service Names....
>
> Works great now! Thanks everybody!
>
> Les
>
>
> -----Original Message-----
> From: Dina Hess [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, March 05, 2003 5:16 PM
> To: CF-Talk
> Subject: Re: cfloop/index question
>
>
> Les,
>
> You may want to consider a different approach.
>
> For example, you could give all of the "service" checkboxes one name, as
in
> NAME="Service," and specify the service code in the value, as in
> VALUE="100."
>
> The value of each "checked" checkbox will be appended to FORM.service so,
on
> the action page, you could just do a list loop over that variable to get
at
> the values, like this:
>
> The following service have been selected:
> <cfloop list="#form.service#" index="service">
> #service#<br>
> </cfloop>
>
> Seems simpler...which is always my goal. :)
>
> ~Dina
>
>
>
> ----- Original Message -----
> From: "Les Mizzell" <[EMAIL PROTECTED]>
> To: "CF-Talk" <[EMAIL PROTECTED]>
> Sent: Wednesday, March 05, 2003 11:13 AM
> Subject: cfloop/index question
>
>
> > I've got a form with a large list of services that a client can click to
> get
> > more info. Depending on where they come from, the checkboxes will
> auto-check
> > a particular service they're interested in, and then they can check a
few
> > more if they wish information on other services.
> >
> > JAVASCRIPT CHECKBOX FUNCTION
> > function makeCheckboxes(){
> > STUFF.service<cfoutput>#rq_SerID#</cfoutput>.checked=true
> > }
> >
> > On the form itself, each checkbox for each service is name like:
> >
> > service100
> > service200
> > service300
> >
> > This works together with the Javascript to check the appropriate box
based
> > on a passed URL variable. This part works great.
> >
> > I'm having a bit of trouble on the processing side to get a CFLOOP
> properly
> > set up to go through all the checkboxes and list the values of the ones
> > checked.
> >
> > Had this working in ASP:
> > "I would like information on the following products." & vbCrlf
> > REM ADD THE CHECKBOXES TO THE CDO EMAIL BODY
> > For i=10 to 720
> > if Request.Form("service" & i) <> "" THEN
> > vBody = vBody & cStr(Request("service" & i)) & vbCrLf
> > END IF
> > next
> >
> > ...but having some trouble translating this over to Cold Fusion...
> >
> > Advice please...
> >
> > Thanks
> >
> >
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more
resources for the community. http://www.fusionauthority.com/ads.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4