My understanding is that you're stuck at trying to get
the "results" that display from submitting the "Vendor"
and "Product" data to be sent along with the other form
input data from the form above when the submit button
under the "Alternate Part Numbers" field, right?

If that's the case, what about simplifying this operation and
put your "Cross Reference" section above the first submit
button.  I don't see where there should be a need to process
the vendor and product cross reference data into a list
for display on template.cfm.  Unless there's some reason I'm
not understanding.

Allow users to use the "add vendor" and "add product" links
to insert more fields into your main form.  You can use
your cfloop code to create your lists on the builderAction.cfm
page instead of going through the difficulty of ajaxing
that info to action.cfm, returning it to template.cfm, and
then trying to get that data passed to builderAction.cfm along
with the form fields in the main form.

In other words, just use the "Cross Reference Form"
functionality to create additional form fields in the main form.

Your users shouldn't get confused by using the "add vendor" and
"add product" links to create additional fields.  (And if they are,
they'll get it after reviewing the post on builderAction.cfm)

Is the data in the form fields just being used for creation of
the .html pages, or is it going into a database, also?

Thoughts on this approach?

Rick

-----Original Message-----
From: Teed Younger [mailto:[email protected]] 
Sent: Wednesday, January 12, 2011 6:17 PM
To: cf-talk
Subject: Re: trying to pass ajax complex strings within another form


Well its the same as this. Originally it didnt have code to loop through the
struct and display the values.

<cfoutput><cfset results = deserializeJSON(url.data)>
<!--- <cfdump var="#results#"> --->
<cfloop collection="#results#" item="itemName">
  <cfset item = results[itemName]>
<!--- <cfdump var="#item#" label="Item Name #itemName#"> --->
  <cfloop collection="#item.vendors#" item="vendorName">
  <ul><li><h2>#vendorName#</h2></li>
    <cfset productArray = item.vendors[vendorName]>
    <!--- <cfdump var="#productArray#" label="Products for vendor:
#vendorName#"> --->
     <cfloop array="#productArray#" index="productName">
<li>#productName#</li></cfloop></ul>
  </cfloop>
</cfloop>
</cfoutput>

Thats the code I added to the action.cfm just to loop through and display.

>What's the code on action.cfm?
>
>
>Well there was a div on the original action.cfm. When I changed the ajax
>function to post to my builderAction.cfm, I didnt pull the div over. I did
>just now, but wasnt exactly sure whether to wrap all the cfoutput and
>cfloops within the div or not. Tried it wrapped then moved it completely
>underneath that section of code.
>
>for
>>what I'm trying to do based on my last post?..lol
>>the
>>>file and saving to our shared folder in the office.
>>>
>>>All that works fine. But the need arose to somehow incorporate a way to
>>>generate lists of varying lengths and most likely several different lists
>>on 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:340711
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to