Forum Discussion
- PhillipDennisQrew CadetYou can use a form rule to prevent the record from being saved if the date is after the current date (see image below).
Adding a form rule that will change the date to the current date if the user tries to set it for a future date works sometimes but not every time. The rule to prevent it from being saved is the better way.
Note that this won't prevent users from entering a future date using grid edit, another form, or the API.
Depending on your use case, you could also create a second date field - a formula date field - to make sure the date is never later than the current date. Users could enter any date they want in the first date field, using any form, grid edit, or the API - and the value of the formula date field would either be the date chosen by the user or the date the record was created, whichever is earlier.
Phillip Dennis - _anomDiebolt_Qrew EliteQuickBase uses the jQueryUI datepicker and the datepicker can be configured through script to allow or disallow dates that meet certain criteria.
See these pasties and links to old forum posts and demos:
Formula for date field to display only first day of each week?
https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=257
Can I use a date - formula field to force users to input only the current date or a past one, no future date
https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=447
Is there a way to only allow certain dates to be selected in a date field
https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=513 - TylerParkerQrew Assistant CaptainHey Dan, if I wanted to force users to input only the current date or a future date, no past date, would I change the "maxDate" here to "minDate"?
$("#_fid_6").datepicker("option", {
maxDate: "0"
});- _anomDiebolt_Qrew Elite
- TylerParkerQrew Assistant CaptainAwesome, thanks for the link