HTML
  Home arrow HTML arrow Page 4 - Showing Any Month with 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

Showing Any Month with a Web Page Calendar
By: Chrysanthus Forcha
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2009-05-04

    Table of Contents:
  • Showing Any Month with a Web Page Calendar
  • The validateDate() Function
  • The Buttons
  • Need to modify the showCurrentMonth() Function
  • Modifying Statements in the showMonth() 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


    Showing Any Month with a Web Page Calendar - Need to modify the showCurrentMonth() Function


    (Page 4 of 5 )

    We had finished with the showCurrentMonth() Function.

    The showCurrentMonth() function has almost all that you need to display the calendar of any month. Should we write a separate function for Any Month’s Calendar? No; this will make the code too long. So, we shall modify the showCurrentMonth() function and any associated feature in the corresponding button’s tag.

    Change the name showCurrentMonth() to showMonth(date, theMonth) at the start of the showCurrentMonth() function. The showCurrentMonth() function did not have any parameters. The new showMonth(date, theMonth), which will be the modification of the showCurrentMonth() function, needs two parameters, which are the date and theMonth. The date parameter is for the date object. The theMonth parameter is to indicate whether we are dealing with the current month or any month.

    Add the following attributes to the button with the Show any Month’s Calendar title.


    onclick="CalJustClicked = true; receiveYearMonth()"


    The “CalJustClicked = true” portion has the same function as for the Show Current Month's Calendar button. The “receiveYearMonth()” portion calls an entirely new function whose name is, of course, receiveYearMonth(). The aim of the function is to get the year and month from the user for the particular month whose calendar he wants.

    This function will issue two prompt dialog boxes. The first one will ask the user for the year whose month he is looking for, and the next one will ask the user for the month (January, February, --- December). This function, receiveYearMonth(), calls the showMonth(date, theMonth) function, which produces the calendar of the month of the user’s choice. The calendar of your (the user’s) choice is what we have been referring to as Any Month’s Calendar.

    Now the onclick attribute of the first button, Show Current Month's Calendar, has to be modified, from


    onclick="CalJustClicked = true; showCurrentMonth()"


    to


    <button type="button" onclick="CalJustClicked = true; showMonth(new Date(),'current')"


    We replace the “showCurrentMonth()” portion of the onclick attribute with “showMonth(new Date(),'current')”. Note that our “showMonth(new Date(),'current')” here, calls the showMonth(date, theMonth) function.

    The date argument in our attribute is “new Date().” This expression creates the current date object. The resulting current date object is sent as an argument.

    The second argument is the word “current.” The showMonth(date, theMonth) function will use this to decide whether or not to create the calendar of the current month.

    More HTML Articles
    More By Chrysanthus Forcha


     

    HTML ARTICLES

    - Hello HTML 5, Goodbye Gears
    - 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







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