Support Forum Softcomplex logo
About Us  | Services  | Download  | Order  | Support  | |
| Search | Today's Posts | Stats | Board Rules | Not logged in [ Login | Register ]
go to bottom
Last active: Never

Printable Version | Subscribe | Add to Favourites   Post new thread
Author: Subject: Limiting dates to a given range
Junior Member

Posts: 3
Registered: 5/5/2010
Location: Indianapolis IN USA
Member Is Offline
posted on 5/5/2010 at 04:32 PM Reply With Quote
Limiting dates to a given range

This is a first post so if it's out of place, bear with me...

I have seen a couple of posts on this issue with no responses. I have implemented limits and thought I would share my results in case they may be useful to others.

In my project, I needed to make the limits visible to the user so the code uses the form elements containing those values. This is not required. Setting up the 'onChange' function is the only real requirement. From there you can decide how to implement this.

Below is my change summary with a very 'thin' example. Changes are required to calendar_db.js (my choice for my project) to create a 'hook' to let you know when a date has been selected.

I am attaching my revised calendar_dsx.js code and would be interested in knowing if anyone found it
1. Usable
2. Functional
3. Useful

2010-May-5 jrw Added code to support to set and enforce limits on
selected dates.
1. User must define a function to be called to
handle the 'onChange' event. This function must
implement the enforcement of limits.
2. User must define global vars and save each tcal
object using the limit feature.
3. User must create input elements to contain the
limit values with unique IDs within the page.
4. User musr create 'Mindate' and 'MaxDate' elements
in A_TCALDEF containing the IDs of the input
elements described in #3 above.
5. User must include an 'onChange' config argument
to tcal passing a reference to the event handler
specified in #1 above.


<script ... src="calendar_ds.js">
A_TCALDEF.MinDate = 'firstdate';
A_TCALDEF.MaxDate = 'lastdate';


function f_ChkLimit(that)
oSTARTDATE = tcal({ ... ,'onChange': f_ChkLimit }
<input ... id="firstdate" ...>
<input ... id="lastdate" ...>
View User's Profile View All Posts By User U2U Member
Post new thread

Related Links:
Product Page
Product Demonstrations Live Demos
Free Download Free Download
Product Documentation Documentation
Support Forum Support Forum

Go To Top

Powered by XMB 1.9.1 Nexus
Developed By Aventure Media & The XMB Group © 2002-2004