wacdesign
wacdesign

Reputation: 3

Passing information to an iframe

I would like users to be able to fill in two text fields and when they click the submit button, those two pieces of information (in this case postcodes) will have been pre-filled out on a form.

You can see an example that works here: https://www.reallymoving.com/first-time-buyers

The trouble is that in my case it will be going to an iframe.

Which you can see in action here: http://www.wacdesign.com/pps/rc/compare.html

But is it possible to pass information from a form on the previous page over to this larger form?

Upvotes: 0

Views: 74

Answers (2)

Wojciech Sobczyk
Wojciech Sobczyk

Reputation: 343

your form when you set method="GET" and submit it will add parameters to the address in form of ?param1=value1&param2=value2

this parameters you can read on the server befor rendering the page Ie in php:

$param1 = $_GET["param1"];

Upvotes: 1

Donovan
Donovan

Reputation: 15917

I think you would need to use a GET, passing the form parameters in the URL to your app.

e.g.

http://www.wacdesign.com/pps/rc/compare.html?form1=value1&form2=value2

This would provide "value1" in the form1 parameter and "value2" in the form2 parameter, which you can then parse in your app.

Upvotes: 0

Related Questions