Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

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

Posted on 2009-12-30
7
Medium Priority
?
259 Views
Last Modified: 2013-12-24
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?
0
Comment
Question by:kabookis
  • 4
  • 3
7 Comments
 

Author Comment

by:kabookis
ID: 26153794
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
 
LVL 16

Expert Comment

by:duncancumming
ID: 26154483
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
 

Author Comment

by:kabookis
ID: 26167182
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 16

Expert Comment

by:duncancumming
ID: 26167380
Could the whole thing be done with javascript?
0
 

Author Comment

by:kabookis
ID: 26167450
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
 
LVL 16

Accepted Solution

by:
duncancumming earned 2000 total points
ID: 26167507
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
 

Author Closing Comment

by:kabookis
ID: 31672356
Yep, that's it, dead on. I think it's gonna work. Thanks for your help.
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other. As you build tables in Microsoft Ac…
Suggested Courses

581 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question