Custom Date Validation

gotpowr 03 Jan, 2011
I have a calendar date field (date_1) that I would like to have custom validation on. I'm not too familiar with php and tried some code but nothing seemed to work. Here's the scenario I'm trying to get to work:

Users are registering for a Tuesday event (always Tuesdays).
For example, Tuesday 1/4/11.
Registration is cut off on the Sunday prior, 12pm noon.
In this example, Sunday 1/2/11 at 12pm noon.

I would like 1 of 2 things (either works).

Users cannot select 1/4/11 as a date to register for at 1/2/11 12:01pm or later.
Users receive a message stating they must choose a later date when submitting 1/2/11 12:01pm or later.

Right now I'm using the 'Direction' in the date field extras, but I'm not sure if that will work correctly with the 12:00pm cut-off. I'm using it tonight (direction 3) and it cut-off the date.

Can I use the direction? I tried '2.5' and '2.75' but I was still able to choose 1/4. So I'm wondering if it will cut-off the date Sunday 12am instead of pm.

Any help is appreciated.
GreyHead 03 Jan, 2011
Hi gotpowr,

I'm pretty certain that the Aeron calendar/datepicker only knows about days so can only cut off at midnight.

As the events are always Tuesday I'd be inclined to use a drop-down instead of a date-picker. Then you can control the dates shown using PHP in the Form HTML. This will work provided that there aren't too many dates open in the future - twenty is probably the practical maximum (though some drop-downs use many more).

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