Solved

Paypal page to iframe

Posted on 2014-03-22
5
928 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 500 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

757 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now