> > 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....
If that's the only reason you're giving each checkbox a unique name, you may
want to consider using a CFIF within your INPUT tag to check the appropriate
checkboxes based on the value of a URL parameter or, better yet, a hidden
form field, like this:
<input type="checkbox" name="service" value="Fluorescent Bulb Disposal"
<cfif form.source is ="Fluorescent Bulb Disposal">checked</cfif>>
That way, you eliminate the need for a cryptic service code that's not truly
tied to the service name. If you ever have a need to check more than one
checkbox based on the source page, you can just pass a list in the hidden
form field and change your CFIF statement to: <cfif
ListFindNoCase(form.source,"Fluorescent Bulb Disposal")>
This solution will also scale well:
<cfoutput>
<cfloop list="#form.service#" index="i">
#i#<br>
</cfloop>
</cfoutput>
~Dina
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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