5,696,038 members and growing! (12,171 online)
Email Password   helpLost your password?
Web Development » Client side scripting » General     Intermediate

Easy Calendar

By Fadi Chamieh

An article that demonstrates a simple yet very powerful Calendar, no need for server-side hussle!
Javascript, Windows, Visual Studio, Dev

Posted: 20 Oct 2004
Updated: 20 Oct 2004
Views: 46,020
Bookmarked: 15 times
Announcements
Loading...



Search    
Advanced Search
Sitemap
15 votes for this Article.
Popularity: 4.24 Rating: 3.61 out of 5
2 votes, 13.3%
1
2 votes, 13.3%
2
0 votes, 0.0%
3
2 votes, 13.3%
4
9 votes, 60.0%
5

Introduction

Ever had a form where you wanted the user to fill-in a date, a valid date? Tried and looked for something to help you out? EasyCalendar is for you!

Using the code

Plain simple: put the EasyCalendar files (except for demo.html - included in the project zip) in your Web/HTML directory, and make very modifications to your original HTML file (it can be ASP, ASP.NET, PHP whatever...) as demonstrated in the demo.html.

The Javascript code will be like:

    <script language="javascript">
    var activeElement = false;
    function setDate( elementName )  {
      activeElement = document.forms[0].elements[ elementName ];
      var w = window.open("DateSelector.html", "DateSelector", 
        "width=280,height=280,resizable=no,scrollbars=no,
        menu=no,location=no,status=no");
      w.focus();
    }
    function GetDateSelectorDate() { return activeElement.value; }
    function SetDateSelectorDate( dateString ) 
     { activeElement.value = dateString; }
    </script>
    

And supposing you have an <input name="date1" readonly="yes"> where you need to set a valid date, just make an anchor with a javascript event, ex: <a href="javascript:setDate('date1')">Change the date</a> and that's it!

Enjoy!

Conclusion

I have fun making tools in JavaScript and I admire the power of DHTML.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Fadi Chamieh



Location: United States United States

Other popular Client side scripting articles:

Article Top
Sign Up to vote for this article
You must Sign In to use this message board.
FAQ FAQ Noise ToleranceSearch Search Messages 
 Layout  Per page   
 Msgs 1 to 8 of 8 (Total in Forum: 8) (Refresh)FirstPrevNext
GeneralUndefined???memberbinoy rajan8:29 11 Aug '08  
GeneralWill it work with ASP.Net Server Comntrols??????????memberbinoy rajan14:33 8 Aug '08  
GeneralactiveElement undefinedmemberant35:10 26 Jun '06  
GeneralRe: activeElement undefinedmemberChamadness6:35 26 Jun '06  
GeneralRe: activeElement undefinedmemberant310:08 26 Jun '06  
Generalundefinedmemberbinoy rajan8:31 11 Aug '08  
GeneralSmall Firefox bugmembermikeo_code1:28 18 May '06  
GeneralThank youmemberspecky853:25 28 Feb '06  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 20 Oct 2004
Editor: Nishant Sivakumar
Copyright 2004 by Fadi Chamieh
Everything else Copyright © CodeProject, 1999-2008
Web19 | Advertise on the Code Project