HTML
  Home arrow HTML arrow Building the Current Year with a Web Page ...
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

Building the Current Year 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-11

    Table of Contents:
  • Building the Current Year with a Web Page Calendar
  • Explanation of the receiveYearMonth() Function
  • Need for More Modification
  • Modification of the showMonth() Function Again

  • 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


    Building the Current Year with a Web Page Calendar


    (Page 1 of 4 )

    In the previous part of this eight-part series on building a web page calendar, we began a discussion of how to get the program to display any month the user wished to see. In this part, we complete that aspect of the application, and take the first step to enabling it to display an entire year. This is the fifth part of the series.

    Show any Month’s Calendar

    As we indicated in the previous part, the tag for the Show any Month’s Calendar is now

    <button type="button" onclick="CalJustClicked = true; receiveYearMonth()">Show any Month’s Calendar</button>

    The aim of this button is to enable you to display a month of your choice. To achieve this, you need to input the year, and the month of the year (January or February --- December).

    When you click the button, it calls the “receiveYearMonth()” function. This function shows a prompt (dialog) box, which receives the year. After that it prompts you, by opening another dialog box, for the month. 

    This is the code for the function:


    function receiveYearMonth()

    {

    var yearMonth = false;


    var year = prompt("Please enter the year.","")

    //check if the year is valid

    if ((year >= 1900)&&(year.length == 4))

    {

    yearMonth = true;

    }

    else

    {

    alert('Year must be made up of 4 digits')

    yearMonth = false;

    }



    if (yearMonth == true)

    {

    var month = prompt("Please enter the month in figures","")

     

    //check if the month is valid

    if ((month >= 1)&&(month <= 12))

    {

    yearMonth = true;

    month--;

    }

    else

    {

    alert('Month must be between 1 and 12, inclusive')

    yearMonth = false;

    }

    }


    if (yearMonth == true)

    {

    var date = new Date(year, month,1);

    showMonth(date, "");

    }

    }


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