PDA

View Full Version : Need help w/ javascript function calculating dates


hogtied
01-03-2003, 09:13 PM
Hello members,

I have this JS script that calculates, populates, and selects dates within comboboxes. This function is called when the page loads as well as when the user changes the dates.

I've attached a text file with this post including the code involved.

The problem I'm having is, on the web page view, if I select Janurary 31. Then change the month to lets say may which has 30 days in the month, I get an error.

Can't seem to pinpoint the cause of the problem.

Also if someone would like to, see if you can simplify this code to do the exactly same thing but take less lines and less processing.
REASON?? when I load the page, it actually takes some time to process the script. So at first I see Jaurary 1, then after the script runs I see the changes taking place. I guess i could leave the Options blank to start out with, since I'm going populate them anyway.....

Thanks
Hogtied

hogtied
01-25-2003, 01:24 AM
your meaning to tell me 12 people downloaded this script and not one had ANYTHING to say about it.. mannnnn That bites.....

Hogtied :mad:

BrainJar
01-25-2003, 05:23 PM
You might find this article of mine helpful:

http://www.brainjar.com/js/calendar/

It covers the concept of the Date object rolling over and what you can do to change that behaviour.

hogtied
01-25-2003, 07:02 PM
Very usefull BrainJar. Thanks...