Hey i'm in the middle of making an event calendar. Each event in the calendar is respresented by a button and when i click it i want to pass some variables with it. Right now it will only let me pass the $id and for some reason neither of my two string variables ($description and $title)
Code for the onClick button and the foreach loop where i get the information:
$event_day = $day_num . '.' . $month . '.' . $year;
foreach ($eventArray as $currentEvent) {
$result = $string->convert_timestamp_to_string($currentEvent['start_date']);
if ($result === $event_day) {
$id = $currentEvent['id'];
$title = $currentEvent['title'];
$description = $currentEvent['description'];
$pageContent .= '<input type="button" class="event" onClick="showDialog('.$id. $description. $title.')" value="' . $title . '"/>';
}
}
Here is the function that's supposed to create the dialog based on the variables passed
var showDialog = function(id, description, title) {
$("#dialog-modal").dialog({title:title});
};
I have tried seperating the variables with commas with no luck.
Thanks in advance.