Hi folks. Got a little problem with I hope you can help me with. I have a simple calendar script which displays a calendar on my website and at present, you enter dates using a seperate xml file.

If you enter an event for a certain date, the event is displayed next to the date. This is fine, all works great, but what I would like to do is actually display the event in a pop-up window.

So you would click on the date , a pop-up window would appear with the event displayed.

Any idea how I would do this? Maybe a bit of js is required, but I'm not too sure...

Here's the current line which displays the date and event..

// if event exists for this day, print day cell with event
    if (isset($event[$dayNo])) {
        echo "\t<td class=\"event\"><b>$dayNo</b>$event[$dayNo]</td>\n";
    }

    Sounds like Javascript; something to do with window.open, no doubt.
    To answer the question implicit in your subject:

    <script type="text/javascript" language="Javascript">
    var js_variable = <?php echo $php_variable?>;
    </script>
    

      I still cant get it to work.
      I've got as far as

      // if event exists for this day, print day cell with event
      	if (isset($event[$dayNo])) {
      		echo "<a href=\"#\" onclick=\"javascript:window.open('calendar.xml?$event[$dayNo]', 'none', 'width=500,height=500');\">$dayNo</a>";
      	}
      

      But when the new window opens, it simply displays the complete calendar.xml file. I cant get it to simply display the value of variable $event[$dayNo]. 😕

        Main reason would appear to be that you're not calling the variable anything.

        calendar.xml?[i]what[/i]=$event[$dayNo]
        

        That being said without knowing anything about calendar.xml.

          I decided to not have the event pop up in a new window but simply list below the calendar.

          Many thanks for your help..

            Write a Reply...