Passing query string to iframe content

883 views
Skip to first unread message

brianyerkes

unread,
Jul 13, 2010, 12:59:52 PM7/13/10
to fancybox
Hi,

I want to pass data via a query string on the link that fires up an
iframe fancybox window....

For example, on my page I have <a href="/more-info.php?propertyid=213"
class="iframe">Request More Information</a>

So, fancybox window displays more-info.php which has a form, and I
want to automatically populate a form field with the query string
data , i.e. 213. I have that working fine if I don't open the form
page in a fancybox iframe window....but I would love to get fancybox
to allow me to pass the query string in the link to the iframed
page....

Any help is greatly appreciated

Thanks

brianyerkes

unread,
Jul 13, 2010, 1:46:52 PM7/13/10
to fancybox
Ok, got it working...

For some weird reason the query string ?propertyid= wasn't working but
changing it to ?q= works. No idea why :/

tony

unread,
Jul 19, 2010, 3:45:53 AM7/19/10
to fancybox
Hi Brian,

I am doing something like this myself now - could you fill me in on
how you got this to work?

I've got an html form that I am using for the iframe content, and I
want to fill in a value there from the page the fancybox loads on.
Sounds like a pretty similar situation to yours! How are you sending
the "q" bit through?

Cheers,

Tony

On Jul 13, 6:46 pm, brianyerkes <awebt...@gmail.com> wrote:
> Ok, got it working...
>
> For some weird reason the query string ?propertyid= wasn't working but
> changing it to ?q= works. No idea why :/
>
> On Jul 13, 12:59 pm, brianyerkes <awebt...@gmail.com> wrote:
>
> > Hi,
>
> > I want to passdatavia a query string on the link that fires up an
> >iframefancybox window....
>
> > For example, on my page I have <a href="/more-info.php?propertyid=213"
> > class="iframe">Request More Information</a>
>
> > So, fancybox window displays more-info.php which has a form, and I
> > want to automatically populate a form field with the query string
> >data, i.e. 213. I have that working fine if I don't open the form
> > page in a fancyboxiframewindow....but I would love to get fancybox

tony

unread,
Jul 20, 2010, 6:17:37 AM7/20/10
to fancybox
Don't worry, come up with a solution - used this:

<?php
// Retrieve the URL variables (using PHP).
$product = $_GET['variable'];
echo $variable."<br/>";
echo "<input type=\"hidden\" name=\"variable\" value=\"$variable\"/
>"
?>

with this link:

<a id="id" href="form.php?variable=xxx&fix?iframe"></a>

The xxxfix was placed in so that the iframe bit was dropped from the
end



On Jul 19, 8:45 am, tony <t...@savant-health.com> wrote:
> Hi Brian,
>
> I am doing something like this myself now - could you fill me in on
> how you got this to work?
>
> I've got an html form that I am using for theiframecontent, and I
Reply all
Reply to author
Forward
0 new messages