HTML
  Home arrow HTML arrow Page 3 - Modifying 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

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

    Table of Contents:
  • Modifying a Web Page Calendar
  • Modification of Some Code Segments
  • Another Modification of the showMonth() Function
  • Limitations of this Approach

  • 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


    Modifying a Web Page Calendar - Another Modification of the showMonth() Function


    (Page 3 of 4 )

    The showMonth() function now has three parameters instead of two. The added parameter is for the letters that represent the months. The function so far can produce only a single month calendar. This same function will now have to produce a calendar of twelve months for the whole year.

    It needs to be modified, but not much. We shall modify what we modified before, and just a bit more.

    The very first statement in this function removes any single month calendar that was opened. We shall add another, similar statement next to this (below). The statement will remove any yearly calendar that was opened. This is the statement:

    document.getElementById('YR').style.display = "none";

    The DIV element that holds the yearly calendar has "YR" as its ID. This ID is used by the above statement. Only one calendar has to be shown at any time. So any calendar that is displayed has to be removed first.

    In the showMonth() function; the statement,

    document.getElementById('I01').value = monthArray[month];

    becomes

    if (monthI == '0')

    document.getElementById('Cal').style.display = "block";

    else

    document.getElementById('YR').style.display = "block";

    We have had to address the situation when dealing with a single month calendar and also the situation when dealing with a yearly calendar. That is why we have an if-statement. If the monthI variable is zero, the single month calendar is displayed. If it is not zero, the yearly calendar is displayed.

    The statement to display the month in the first Input Text control was

    document.getElementById('I01').value = monthArray[month];

    It is now replaced by two statements, that is:

    InputTextID1 = 'I'+ monthI + '1';

    document.getElementById(InputTextID1).value = monthArray[month];

    The first line constructs the ID, taking the particular month into consideration. The second line displays the value.

    The statement to display the year in the second Input Text control was

    document.getElementById('I02').value = year;

    It is now replaced by two statements, that is:

    InputTextID2 = 'I'+ monthI + '2';

    document.getElementById(InputTextID2).value = year;

    The explanation is similar to the above.

    Each of the for-loops has to form the ID of a table cell in the table for each month (whether we are dealing with a single month calendar or a yearly calendar). The line for each of the for-loops was

    tdID = "M0" + i + j;

    This took into consideration the fact that we were dealing with a single month calendar. Now we have to deal with a single month and a yearly calendar. So this line is now

    tdID = "M" + monthI + i + j;

    The ID for the table cell still starts with the letter, M, followed by another letter, A or B or C --- L, which represents a month; then the row and column numbers, respectively.

    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 6 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek