HTML
  Home arrow HTML arrow Page 2 - 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 - Modification of Some Code Segments


    (Page 2 of 4 )

    To avoid having a lot of code, we shall modify some of our code segments so that the same segment can be used by different features of the calendars.

    Modifying the removeCal() function

    The aim of the removeCal() function, as we saw, was to remove the single month calendar. Well, we have to extend this to remove the yearly calendar as well. The statement that removes the single month calendar is:

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

    In the above statement, the ID of the DIV for the single month calendar is Cal. The ID for the main DIV element for the yearly calendar is YR. If you remove the main DIV element from the web page, you remove the yearly calendar.

    The statement to remove the yearly calendar is placed just below the one above. The event which triggers the removal of the yearly calendar is the same as for the monthly calendar -- namely, clicking outside on the BODY element. The statement to remove the yearly calendar is:

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

    Everything else in the removeCal() function remains the same. So, when you click outside on the BODY element, if the single month calendar was displayed, it would disappear; if the yearly calendar was displayed, it would disappear.

    Modification of the First Button's Attribute

    The call in the onclick attribute of the Show Current Month's Calendar button is now

    showMonth(new Date(),'current','0')

    instead of

    showMonth(new Date(),'current')

    This is because the showMonth(date, theMonth, monthI) now has three parameters instead of two. The parameter added is monthI. The first parameter receives the date object; the second one receives a value that indicates whether or not we are dealing with the current month. The third parameter, monthI, receives a letter that represents the month of the year.

    For the onclick attribute above, the arguments for the three parameters are "new Date()", "'current'" and "'0'" respectively. The first argument is "new Date()"; the button creates the current date before sending. The second argument is "current" because we want the current month. The value 0 (that is zero) is sent here, because we want a single month calendar. I will explain how this is used in the showMonth() function shortly.

    A similar modification is done for the receiveYearMonth() function, called when you click the Show any Month's Calendar button. The last statement in the receiveYearMonth() function is now

    showMonth(date, "", '0');

    and no longer,

    showMonth(date, "");

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