I am currently grabbing data from a mysql db and presenting it to the user in
a table.  In certain cases, a volunteer button is displayed to the user.  I
want the user to click on the volunteer button, and have an iframe dialog
pop up.  When the user clicks on this volunteer button, the corresponding
"date" column should be passed to the iframe (which in turn uses the iframe
to look up the correct data in another db).  I can't seem to figure out how
to pass the "date" variable.

here is part of my php file:

[code]
while($row = mysql_fetch_array($result))
{
        echo "<tr><td>";  }
        echo $row['date'];
        echo "</td><td>";
        if ($row['location'] == "PVI")  {
              echo "<input type='button' value='Volunteer' name='volunteer'
id='volunteer' />";
        echo "</td></tr>";
....
[\code]

That part works fine.  When the user clicks on the Volunteer button, here is
the jquery code:

[code]
$('#volunteer').click(function(){         * need to get date in here
somewhere!
        popup(date);
        return false;
});
[/code]

And here is the popup part - I actually get the dialog, but since I can't
figure out how to pass the date, it can't look up the correct info!

[code]
function popup() {
    var url = 'popup.php?date='+ date;  
    $('<iframe id="popup" src="' + url + '" />').addClass("flora").dialog({  
                modal: true,
                        resizable: true,
                        bgiframe: true,
....
[/code]

If anyone could point me in the right direction, I'd appreciate it!
-- 
View this message in context: 
http://www.nabble.com/pass-variable-from-button-click-to-iframe-tp21207413s27240p21207413.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.

Reply via email to