Click here to Skip to main content
Licence 
First Posted 20 Oct 2004
Views 65,270
Bookmarked 22 times

Easy Calendar

By | 20 Oct 2004 | Article
An article that demonstrates a simple yet very powerful Calendar, no need for server-side hussle!

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



United States United States

Member



Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralJavaScript mounth Calendar Pinmembershareef22200022:11 2 Jul '09  
GeneralRe: JavaScript mounth Calendar PinmemberChamadness1:24 3 Jul '09  
QuestionUndefined??? Pinmemberbinoy rajan7:29 11 Aug '08  
QuestionWill it work with ASP.Net Server Comntrols?????????? Pinmemberbinoy rajan13:33 8 Aug '08  
GeneralactiveElement undefined Pinmemberant34:10 26 Jun '06  
GeneralRe: activeElement undefined PinmemberChamadness5:35 26 Jun '06  
GeneralRe: activeElement undefined Pinmemberant39:08 26 Jun '06  
Generalundefined Pinmemberbinoy rajan7:31 11 Aug '08  
GeneralSmall Firefox bug Pinmembermikeo_code0:28 18 May '06  
GeneralThank you Pinmemberspecky852:25 28 Feb '06  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web01 | 2.5.120528.1 | Last Updated 20 Oct 2004
Article Copyright 2004 by Fadi Chamieh
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid