HTML
  Home arrow HTML arrow Creating a Web Page Calendar
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
HTML

Creating a Web Page Calendar
By: Chrysanthus Forcha
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2009-04-20

    Table of Contents:
  • Creating a Web Page Calendar
  • The Date Object
  • The showCurrentMonth() Function
  • Skeleton of the showCurrentMonth() Function

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Creating a Web Page Calendar


    (Page 1 of 4 )

    Welcome to the second part of an eight-part series on building a web page calendar. In this part of the series, I will explain the function that is used to create the current calendar. When the Show Current Month's Calendar button is clicked, it should call a function that will display the calendar of the current month. We need to modify it; the showCal() function we saw in the previous part has only one line. We will change this function and use it as the showCurrentMonth() function.

    The Current Month

    Change the name of the showCal() function to showCurrentMonth(). Erase its one line content. We shall give it new content. Replace the HTML code for the calendar with the following, which now has IDs and no cell contents:


    <div id="Cal" onclick="CalJustClicked = true;">

    <input type="text"class="calHead" id="I1" readonly><input type="text" class="calHead" id="I2" readonly>

    <table border="1">

    <tr><td class="sun">S</td><td>M</td><td>T</td><td>W</td>
    <td>T</td><td>F</td><td>S</td></tr>

    <tr><td class="sun" id="M00"></td><td id="M01"></td>
    <td id="M02"></td><td id="M03"></td><td id="M04"></td><td id="M05"></td><td id="M06"></td></tr>

    <tr><td class="sun" id="M10"></td><td id="M11"></td>
    <td id="M12"></td><td id="M13"></td><td id="M14"></td>
    <td id="M15"></td><td id="M16"></td></tr>

    <tr><td class="sun" id="M20"></td><td id="M21"></td>
    <td id="M22"></td><td id="M23"></td><td id="M24"></td>
    <td id="M25"></td><td id="M26"></td></tr>

    <tr><td class="sun" id="M30"></td><td id="M31"></td>
    <td id="M32"></td><td id="M33"></td><td id="M34"></td>
    <td id="M35"></td><td id="M36"></td></tr>

    <tr><td class="sun" id="M40"></td><td id="M41"></td>
    <td id="M42"></td><td id="M43"></td><td id="M44"></td>
    <td id="M45"></td><td id="M46"></td></tr>

    <tr><td class="sun" id="M50"></td><td id="M51"></td>
    <td id="M52"></td><td id="M53"></td><td id="M54"></td>
    <td id="M55"></td><td id="M56"></td></tr>

    </table>

    </div>


    The cells in the second row (not the first) have been given IDs, namely M00 and M01 through M06. Those in the third row have been given the IDs M10, M11, and so forth. The IDs have been given in this way, until in the seventh row, the IDs are M50 and M51 through M56.

    Note that there are seven rows in the table and not six. The first row is taken up by the abbreviations of the days of the week. I have not given them IDs. Their contents do not need to be changed. Note the IDs and attributes I have given to the Input Text elements. The first one will have the name of the month and the second one will have the year.

    Now, we have changed the name of the function that is called by the "Show Current Month Calendar" button. We have to modify the attribute of the button accordingly. The button tag should now be:


    <button type="button" onclick="CalJustClicked = true; showCurrentMonth()">Show Current Month's Calendar</button>


    Before we leave this section, note that the table cells currently hold no content; that is, they are all blank.

    More HTML Articles
    More By Chrysanthus Forcha


     

    HTML ARTICLES

    - Comparing Browser Response to Active Client ...
    - Testing Browser Response to Active Client Pa...
    - Active Client Pages: Completing the Code for...
    - ACP and Browsers: Setting up an Example
    - How Browsers Respond to Active Client Pages
    - Completing a Tree with Active Client Pages
    - HTML Form Verification and ACP
    - Building an ACP Tree
    - Completing an ACP 3D HTML Table Image Gallery
    - Building an ACP 3D HTML Table Image Gallery
    - A Multiple Page Image Gallery with Active Cl...
    - Building an Image Gallery with Active Client...
    - Concluding a Menu for All Browsers
    - A Vertical Menu for All Browsers
    - Downloading Long HTML Pages with ACP







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek