Force calendar picker to specific date?

Aroberts3 29 Jul, 2010
I have a form where you are supposed to put in a child's birthdate. But in order to manually go to that date from today it takes about 90 clicks. Is there a way so that I can make the calendar go to a specific date to start? Or is there a way that they can just manually type in the date?

Then I need to validate the date because the date has to be between a certain date range to verify that the children are the correct age. I don't even know where to start. Except I am trying to make my way through http://www.electricprism.com/aeron/calendar/#manual but I am still sadly confused.
GreyHead 29 Jul, 2010
Hi ARoberts3,

You can add year and month arrows (not terribly good ones but they work) with the navigation: 2 parameter

navigation - An integer–0, 1 or 2–indicating which navigation method the class will use: traditional navigation (1) where left and right arrows allow the user to navigate by month (default); improved navigation (2) where the user can navigate by month or year; and static navigation (0) which is actually no navigation at all.


You can add a default date by setting a value attribute for the input.

You can allow a date to be types by using a plain text field (but that gives you other validation problems).

YOu can validate a date ragne wither by writing a Javascript validator (or a custom Validation); or by using PHP in a serverside validation.

Bob
Aroberts3 30 Jul, 2010
Where do I put in the 2 parameter? I checked the different settings but I didn't see something like this. Is it somewhere in the html code or somewhere else?

Thank you by the way for answering my post. It is greatly appreciated!
GreyHead 30 Jul, 2010
Hi ARoberts3,

In the Date Fields Extras box at the bottom of the Form General Tab. I think it needs to be
classes: ['dashboard'], navigation: [2]


Bob
Aroberts3 30 Jul, 2010
Yipee!!! I love you!

So now for that default date. How would I put in 1/1/2000?

And where would you suggest I start to teach myself how to write a javascript validator?
GreyHead 30 Jul, 2010
Hi ARoberts3,

So now for that default date. How would I put in 1/1/2000?

Put the attribute value='1/1/2000' into the input
<input id="date" name="date" type="text" value='1/1/2000' />


And where would you suggest I start to teach myself how to write a javascript validator?

W3Schools has good tutorials but I'd suggest that you find someone to do it for you.

Bob
Aroberts3 31 Jul, 2010
You have been very helpful. I think I found someone to hire to write the javascript for me.

The programmer will probably do the following items, but just so I know and so I am learning with the process:

1. Where would I have put the code from the previous post? <input id="date" name="date" type="text" value='1/1/2000' />

2. The javascript will end up being placed in the "Form Code" tab under javascript right?

Thanks again for being willing to help!

Angela
GreyHead 31 Jul, 2010
Hi Angela,

If you look in the Form Code Tab | Form HTML box you will find a line similar to that input. You just need to add the value attribute to it.

And yes, JavaScript goes in the Form JavaScript box - without <script> tags as ChronoForms will add those.

Bob
This topic is locked and no more replies can be posted.