DMXzone Lightbox Support Product Page

This topic is locked
Answered

Passing a Form Variable To A Lightbox[SOLVED]

Asked 13 Jul 2011 20:57:13
1
has this question
13 Jul 2011 20:57:13 Bobby Edgar posted:
I am able to pass a form variable easily to a page, but what I want to do is to pass that variable to the page in the lightbox.

Here's a link to the page without lightbox that works: Enter a zipcode and it'll fill in the city and state.

headshotsandresumes.com/no_lightbox_variable_works.php

Here's a link to the page with lightbox that doesn't work: Enter a zipcode and it doesn't fill in the city or state.

headshotsandresumes.com/lightbox_variable_does_not_work.php

Here's the code I used to send the variable to the page without lightbox and it works fine:

<form action="../signup_1.php?SF_Zipcode=<?php echo $_POST['SF_Zipcode']; ?>" method="get" enctype="multipart/form-data" name="reg_start" id="reg_start">
<table width="100%" border="0" cellspacing="1" cellpadding="1">
<tr>
<td width="40%"><span class="white_links">Your Zipcode:</span></td>
<td width="49%">
<input name="SF_Zipcode" type="text" class="blue_forms" id="SF_Zipcode" /></td>
<td width="11%"><input name="button" type="submit" class="blue_button" id="button" value="Go" /></td>
</tr>
</table>
</form>

And here it is with the lightbox and the page loads in lightbox, but the variable does not get passed:

<form action="" method="get" enctype="multipart/form-data" name="reg_start" id="reg_start" onsubmit="openDMXzoneLightbox('../signup_1.php?SF_Zipcode=<?php echo $_POST['SF_Zipcode']; ?>', {width:800, height:650, preset:'simple', plugin:'url'}, window);return document.MM_returnValue">
<table width="100%" border="0" cellspacing="1" cellpadding="1">
<tr>
<td width="40%"><span class="white_links">Your Zipcode:</span></td>
<td width="49%">
<input name="SF_Zipcode" type="text" class="blue_forms" id="SF_Zipcode" /></td>
<td width="11%"><input name="button" type="submit" class="blue_button" id="button" value="Go" /></td>
</tr>
</table>
</form>

Am I missing something simple here?

Thanks in advance for your help.

-Bobby


Edited by - Bobby Edgar on 13 Jul 2011  20:57:47

Edited by - Bobby Edgar on 13 Jul 2011  21:10:05

Replies

Replied 14 Jul 2011 15:39:30
14 Jul 2011 15:39:30 Bobby Edgar replied:
I just had a very lengthy "Live Support" session with Miro and he worked hard to get this to work for me. Here's a transcript of our chat for anyone who wants to accomplish this:

Bobby:
Hello. I posted a support question regarding Lightbox and how to send a URL variable to it. Can you take a look at the post and see if you can help?

-Bobby

Welcome Bobby! Your request has been directed to the Technical Support department. Please wait for our operator to answer your call.

Call accepted by operator Support / Miro. Currently in room: Bobby, Support / Miro.

Support / Miro:
Hello Bobby.
Support / Miro:
How are you today ?
Bobby:
I'm well, and you?
Support / Miro:
Bloody hot is here...
Bobby:
It's nice and cool here in New York. Finally.
Support / Miro:
Okay ... how do you set up the Lightbox ?
Support / Miro:
on a existing link or?
Bobby:
Using a form. There are sample links on the support post.
Support / Miro:
I see .. okay ...
Support / Miro:
are you using the submit form in a lightbox?
Support / Miro:
behavior
Bobby:
The page that has the form has the OnSubmit to Lightbox
Support / Miro:
hold on a sec ...
Bobby:
Thanks Miro...
Support / Miro:
okay ...
Support / Miro:
your form must have an action attribute set to the page where you like the value passed and target attribute set to dmxLightbox
Bobby:
Ok...How do I set the Target to dmxLightbox?
Support / Miro:
target="dmxLightbox"
Bobby:
Can you look at the form code on the post and re-arrange it to show me what to do?
Support / Miro:
<form action="signup_1.php" method="get" enctype="application/x-www-form-urlencoded" name="reg_start" target="dmxLightbox" id="reg_start">
Support / Miro:
this must be sifficient
Support / Miro:
sufficient
Bobby:
Ok. But then how do I setup the Lighbox to accept the variable and open the page?
Support / Miro:
the action page will be opened in the Lightbox
Support / Miro:
and with $_GET['fieldID'] you will be able to get the field value
Bobby:
It kind of works now.
Bobby:
headshotsandresumes.com/lightbox_variable_does_not_work.php
Bobby:
But I have now contorl over the look or anything...
Support / Miro:
mm... yes...
Bobby:
no control, ...sorry for my spelling
Support / Miro:
that is so
Support / Miro:
maybe there is a workaround
Support / Miro:
but some handcoding...
Support / Miro:
with jQuery
Support / Miro:
remove the target from the Form tag
Support / Miro:
apply again Open Lightbox behavior on submit
Support / Miro:
and pass me the page
Bobby:
The link to the page?
Support / Miro:
no the page itslef
Support / Miro:
will make some magic for you
Support / Miro:
make sure you have all set up in the look and feel
Support / Miro:
for the lightbox

Bobby has sent a file. Click lightbox_variable_does_not_work.php (11.3 KB) to receive the file.

Bobby:
Ok. Got it.
Support / Miro:
okay hold on a sec
Bobby:
it's a template based page. Should I detach it from the template and resend?
Support / Miro:
no
Bobby:
Ok. Thanks A Million Miro.

Support / Miro has sent a file. Click lightbox_variable_does_not_work.php (11.3 KB) to receive the file.

Bobby:
YOU ARE THE BEST!!! THANK YOU SO SO SO MUCH!
Bobby:
So I just need to put '+jQuery('#some_form_variable).val() into the variable sent to the lighbox, and it'll work? You are awesome!
Support / Miro:
it is jQuery('#form_Element_ID').val()
Support / Miro:
and this returns the value that the form element has
Support / Miro:
if the form element is empty ... it will return empty alue
Support / Miro:
value
Bobby:
I never would have figured that out on my own. I owe you a drink My wife and I will be in Germany for Christmas. Maybe we can celebrate this victory then ...
Support / Miro:
It would be very nice ... but I"m located in Bulgaria
Bobby:
I'll make the trip. Thanks again. You've saved me lots of time and frustration.
Support / Miro:
you are welcome

Reply to this topic