Hey, Teed...

It's going to take me a little longer than I thought to
work up this functionality.  It's almost 10pm here on
the East Coast of the US (where are you, anyway?).

So, if it's alright, I'll get back on this first thing
tomorrow morning and finish it up.  I've got a lot of it
done, but more to figure out.

Would that work for you?

Rick

-----Original Message-----
From: Rick Faircloth [mailto:[email protected]] 
Sent: Wednesday, January 12, 2011 8:39 PM
To: cf-talk
Subject: RE: trying to pass ajax complex strings within another form


Replies inline...

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


>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?
>

Yes thats correct.I'm stuck at trying to pass the data the cross reference
form creates along with data the other form elements pass.

Rick: Got it...

>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.

Thats how I initial tried to di it. Cant remember what error was thrown
though. I will try that again. So to be sure, remove the cross reference
submit button and use the first form submit button to pass all data to the
builderAction.cfm. Again, not sure that will work.

Rick: I'm sure I can make this work.  I'm working up a sample solution
with the techniques now.

>
>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.

Not exactly sure Im following you here. Ideally I would think the cross
reference form could be simplified and maybe not even use the ajax
function??? is that a posibility. The true affect I wanted from it anyway
was to be able to "add" lists as needed. Meaning add another vendor and
product, or add more than one product for each vendor.

Rick:  Right... we don't need the ajax function at all.
They will be able to click "add vendor" and "add product" links needed.


>
>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
>

And eventually yes this will in some part need to be submitted to a
database. Does that have any bearing on which approach to take here? I hope
you can read my reply as I tried to address each question and comment you
had after each one.

Rick: It won't matter if the data is going into a database for this
functionality.
I was just trying to make sure your goal wasn't that currently.  Then it
would affect
my recommendations.  I'll hopefully have you a working example within 30
minutes.


>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. 





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

Reply via email to