I came up with a solution for this. Still happy to hear if someone
has a better idea though.
What I did was send the link back to the same page with the eventID
<a href='index.php?eventId=1'><span class="file">Event One</span></a>
I then grab that at the beginning of the file
<?php $myvar = $_GET['eventId'];?>
And set a conditional for the <body> element
if ($_GET['eventId']){
echo '<body onLoad="$(\'#dialog\').dialog(\'open\')">';
}else{
echo '<body>';
}
Because I've set that variable prior, I can use it to pass to the
dialog box information. As a test I've just set the title with it -
but will be able to use it in an sql query to filter the information
loaded into the dialog box.
<div id="dialog" title=<?php echo $myvar ?>>
I would rather not have to do the page load, but it's hardly
noticeable - and it works.
Hez
On Feb 16, 5:01 pm, Hez <[email protected]> wrote:
> Hi,
>
> I'm hoping this is an easy question. I have a dialog box that I want
> to pass a variable to but am not sure the right way to do it.
>
> This is the dialog creation
>
> // Dialog
> $('#dialog').dialog({
> autoOpen: false,
> width: 700,
> height: 500,
> buttons: {
> "Ok": function() {
> $(this).dialog("close");
> },
> "Cancel": function() {
> $(this).dialog("close");
> }
> }
>
> });
>
> This is the contents of the dialog...
>
> <!-- ui-dialog -->
> <div id="dialog" title="Event">
> <div id="etabs">
> <ul>
> <li><a href="#etabs-1">Details</a></li>
> <li><a href="#etabs-2">Location</a></li>
> <li><a href="#etabs-3">Attendees</a></li>
> <li><a href="#etabs-4">Photos</a></li>
> <li><a href="#etabs-4">Comments</a></li>
> </ul>
> <div id="etabs-1"></div>
> <div id="etabs-2"></div>
> <div id="etabs-3"></div>
> <div id="etabs-4"></div>
> </div>
> </div>
>
> And this is how I'm accessing it.
> <a onClick="$('#dialog').dialog('open')"><span class="file">Event One</
> span></a>
>
> Basically what I need to be able to do is to pass an eventId through
> the link so the dialog opens up with the information for that event.
>
> Any help would be most appreciated.
>
> Thanks,
> Hez
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---