Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Paypal page to iframe

Posted on 2014-03-22
5
Medium Priority
?
1,154 Views
Last Modified: 2016-03-24
Here is my code:
<body onload = "document.forms.paypalform.submit();">
	<iframe src='about:blank' name='paypalframe' id='paypalframe' frameborder='1' height='500' width=100%'></iframe>
	<form name="paypalform" action="https://www.paypal.com/cgi-bin/webscr" method="post" target="paypalframe">
		a bunch of hidden input tags for Paypal...
	</form>
</body>

Open in new window

The Paypal page does not appear in the iframe

The code works fine without the target tag and it works fine with the form's target="_blank" but the iframe just remains blank with the form's target="paypalframe".

The code is in a php script.

What's the problem?
TIA
0
Comment
Question by:thenelson
  • 3
  • 2
5 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 39947489
Question doesn't make sense.
The iframe has no source so of course it will be blank.
Your paypal code has nothing to do with the iframe
0
 
LVL 39

Author Comment

by:thenelson
ID: 39947501
The form has a target tag: target="paypalframe"

See: http://www.w3schools.com/html/html_iframe.asp "Use iframe as a Target for a Link".
And http://www.w3schools.com/tags/att_form_target.asp "framename      The response is displayed in a named iframe"
0
 
LVL 58

Accepted Solution

by:
Gary earned 2000 total points
ID: 39947520
Ok missed that
You cannot load PayPal in an iframe, its a security risk and they prevent it happening.
0
 
LVL 39

Author Closing Comment

by:thenelson
ID: 39947561
Oh well, thanks.
0
 
LVL 39

Author Comment

by:thenelson
ID: 39947574
How about a followup question:
Using target="_blank"; when I submit the form with a button, the Paypal page loads into a new tab. When I submit the form with the onload event, the Paypal page loads into a new window. Any way to automatically submit the form to a new tab?
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses
Course of the Month20 days, 19 hours left to enroll

810 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