PHP Classes

File: docs/example2.html

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  Classes of Christoff Truter  >  PHP Calendar  >  docs/example2.html  >  Download  
File: docs/example2.html
Role: Documentation
Content type: text/plain
Description: Documentation explaining example 2
Class: PHP Calendar
Generate month calendar that can be used in forms
Author: By
Last change:
Date: 8 years ago
Size: 2,289 bytes


Class file image Download

<link rel="stylesheet" type="text/css" href="style.css" />



<div class="header">
<div class="title">CS Trüter</div>
<div class="scriptName">PHP Calendar Documentation</div>
<div class="version">version 1.0</div>

<div class="body">

<a href="index.html">Back</a>


<div class="body">
<b>Example 2 - Form Example</b><br/><br/>
    <title>Calendar Example 2</title>

    (1) <script language="javascript" src="js/calendar.js"></script>

    <link rel="stylesheet" type="text/css" href="styles/calendar.css" />
    <form method="POST">
            include "includes/PHP4/calendar.php"; 
            $calendar = new Calendar("example2"); 
            (2) $calendar->inForm = true; 
            echo $calendar->Output(); 
        <input type="submit" />


When containing the Calendar object inside a form, you'll need to do the following:
(1) Include the javascript file called calendar.js (you'll find in the js folder), to your head tag, this file
eliminates postbacks and server interaction<br/><br/>
(2) You will need to set the inForm property to true, this tells the component, 
that we're using it inside a form.<br/><br/>

<b>More than one Calendar?</b><br/><br/>
What happens when we want more than one calendar on a page? Well, we simply instantiate a second object
and specify a different ID for that object - and we're ready for launch.<br/><br/>

When using the object inside a form, insure that you place it within the form tags, else you wont get any
value back from your control.<br/><br>


Its interesting to note, what happens to the Microsoft calendar component (and 
a few of the others) when one disables javascript, it stops functioning!<br/><br/>
Luckily you wont have the problem here, when Javascript is disabled, the server
intervenes, and the calendar keeps functioning.<br/>

<div class="footer">
&copy; 2006 CS Trüter <a href=""></a>