How about a form like

Brand name : <INPUT FIELD name=brand1>
Part numbers: <text area name=brand1_parts> (please enter each part number
on a new line)

Should be easy to then process, you just grab <barand1> then loop over
<brand1_parts> to get all the part numbers.

If you need to create more fields just have a button that duplicates the
above for additional entries.

If you want to do all this the easy way then try www.formassembly.com the
free account allows you to generate this type of form, including the
duplicate functionality.

Russ
-----Original Message-----
From: Teed Younger [mailto:[email protected]] 
Sent: 29 December 2010 19:34
To: cf-talk
Subject: Re: cfloop working but not how I want it too:


Ok this is an application I built myself that essentially builds new html
pages via input forms stored as cf variables. The goal of this particular
piece of code would ultimately be that the user can create a list or
multiple lists dynamically. Here would be a quick example of how one current
might look on our site.

Osram
  11324
  11324-10
  11324-15

Eiko
  11224
  11225
  11226

Ushio
  22357
  22357/35w
  22357/50w

Now each names above would be the brand name so to speak, with each
underlying numbers part numbers for their corresponding brand names.

The brand names would be displayed in lists and heading tags, then the
numbers displayed in just plain list items.

I couldn't think of any easier way for the data entry to be done other than
a textarea form field, since there may be 1 lists like above, or there may
be 20 lists like above. Thats why, as you see, I tried to specify different
delimiters so that the text to be displayed as brand names would loop
through and be the first of each list and get styled with the heading tags.

I also thought about using arrays for this application, but I'm fairly new
to arrays and cfloops, and this seemed much easier th work through.

Again, it IS display a listbased on the text in the textarea, but I have yet
to get it to display it properly as the example above.

I hope this makes it more understandable. Thanks again!



> As an alternative...
> 
> Given what you are trying to accomplish and not knowing all of your 
> goals
> this may not work, but it's an option.
> 
> Have you considered giving your users access to a WYSIWYG editor such 
> as
> CKEditor (http://ckeditor.com/) or the many other offerings around 
> these
> days:
> http://www.queness.
> com/post/212/10-jquery-and-non-jquery-javascript-rich-text-editors
> 
> <http://www.queness.
co> m/post/212/10-jquery-and-non-jquery-javascript-rich-text-editors>With
> a WYSIWYG editor, you users can create the literal HTML you're trying 
> to
> output, rather than parsing through the text to display it.
> 
> =]
> 
> -- 
> Alan Rother
> Manager, Phoenix Cold Fusion User Group, www.AZCFUG.org
> Twitter: @AlanRother




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340309
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to