How to append collected name/value pairs to iFrame source code

I have to add 2 form fields ( "Name" and "Org")  to a YouSendIt iframe:

<iframe id="file_upload_iframe" name="file_upload_iframe" src="http://www.yousendit.com/ibox/v1/ibox.php?sitebox=9876543&custom_postback=true&custom_redirect=true&send_notification=true(&Name=Bob&Org=Little League"(style="display:block;" width="350" height="350" marginwidth="0" align="middle" frameborder="0" scrolling="no" allowtransparency="true"></iframe>

I've been coding ColdFusion for awhile and have some abilities scripting Ajax, but I don't know what to do.
What's the best approach for this?
kabookisAsked:
Who is Participating?
 
duncancummingCommented:
well you want to be able to change the src attribute of your iframe, based on what the user has entered in the other form.  Here's a useful article that might help you.  I've linked to page 2 as that seemed relevant, but you might want to read the whole thing.

http://www.devarticles.com/c/a/JavaScript/Working-with-IFRAME-in-JavaScript/1/

0
 
kabookisAuthor Commented:
OK, I figured it out one way.

Loop over the form variables and append the YouSendIt string:

<CFSET str="https://www.yousendit.com/v1/ibox.php?sitebox=9876543&send_notification=true&custom_redirect=true">



<CFLOOP INDEX="allFields" list="#Form.FieldNames#">
<CFSET str = str & "&#LCase(TheField)#=#URLEncodedFormat(Form[allFields])#">
</CFLOOP>


Str: <cfoutput>#str#</cfoutput>

But it would be better if the entire string could be appended and submitted  in one step.

0
 
duncancummingCommented:
If you only have 2 fields, and you already know their names, I'd say the loop is overkill (unless you intend to increase the fields).  Why not just:


<CFSET str="https://www.yousendit.com/v1/ibox.php?sitebox=9876543&send_notification=true&custom_redirect=true&name=#URLEncodedFormat(Form.Name)#&org=#URLEncodedFormat(Form.Org)#">

Open in new window

0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

 
kabookisAuthor Commented:
I should have been more specific with my question. It's not just about appending values to a string.

I have 6 form fields in a separate form whose values must be included with the iframe form submission.

Am I correct in thinking that this will always have to be a 2 step process, i.e., 1) setup and submit the separate form to the loop, then 2) present the iframe where the user will fill in the iframe form values, and click the submit button? Is there some way to roll all of this into a single submit?

Thanks.

0
 
duncancummingCommented:
Could the whole thing be done with javascript?
0
 
kabookisAuthor Commented:
Yes, I suspect that's a possibility. I'm a relative JS newbie, though - do you have any suggestions on how I might proceed?

Thanks.
0
 
kabookisAuthor Commented:
Yep, that's it, dead on. I think it's gonna work. Thanks for your help.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.