Form Tools
Disable calendar in Date field (adding validation) or modify date range for pop up - Printable Version

+- Form Tools (https://forums.formtools.org)
+-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1)
+--- Forum: General Discussion (https://forums.formtools.org/forumdisplay.php?fid=5)
+--- Thread: Disable calendar in Date field (adding validation) or modify date range for pop up (/showthread.php?tid=2528)



Disable calendar in Date field (adding validation) or modify date range for pop up - johnbleck2 - Jul 12th, 2013

We are looking to use a date field that submitters will normally be entering between 50-75 years from the current date. Since the calendar pop up does not have a "scroll" for year I would like to either disable the calendar and keep a date field (and force submitters to use a mm/dd/yyyy format and validate on that format), or at the very least change the default value for the calendar to 50 years prior to current date.

I noticed there are many "options" for date-range in the daterangepicker.jquery.js, but I have no idea how to enable a different date range than the current date or 'today' for the calendar on a date field.

Is there an obvious or easy way to do this that I just haven't noticed?







RE: Disable calendar in Date field (adding validation) or modify date range for pop up - johnbleck2 - Jul 15th, 2013

For my purpose, I was able to modify the formtools/mysite/themes/default/scripts/jquery-ui-1.8.6.custom.min.js

Looking at the jquery documentation for this widget, I was able to modify the default range for the year pulldown.
Default is yearRange:"c-10:c+10"
I changed it to yearRange:"c-100:c"

If dealing with birth dates, I would suggest c-125:c since we continue to live longer. I think the oldest individual is 120? Anyway, this solves my problem. Just wanted people to know what to modify for increasing the year range in the calendar.

One final note: Avoid using a negative number after the : for this variable. The Max expects to be at least the current date, if you use a negative year for the max, the calendar comes up with bad data.


RE: Disable calendar in Date field (adding validation) or modify date range for pop up - Joe - Jul 17th, 2013

John,

Thanks for posting your solution.

Cheers,

Joe


RE: Disable calendar in Date field (adding validation) or modify date range for pop up - saeed20 - Jun 16th, 2020

property for sale in budapest


RE: Disable calendar in Date field (adding validation) or modify date range for pop up - liam john - Oct 17th, 2020

The attractive combination of vibrant and subtle colors present in the Descendants 2 Carlos Jacket is the perfect portrayal of the work of a proficient mind. New American Jackets has kept the color as well as the skin-fit feature of this jacket just as the same that you adore.


RE: Disable calendar in Date field (adding validation) or modify date range for pop up - katuupaul - Oct 28th, 2020

(Oct 17th, 2020, 3:39 AM)liam john Wrote: The attractive combination of vibrant and subtle colors present in the Descendants 2 Carlos Jacket is the perfect portrayal of the work of a proficient mind. New American Jackets has kept the color as well as the skin-fit feature of this jacket just as the same that you adore.

Technical Analysis course in Hyderabad

NCFM Academy Hyderabad - A.S.Chakravarthy, Stock Market Technical Analysis Training Course Institute in Hyderabad, on Stock Market Courses for Share Trading & Investment is The First, Best, Oldest and Leading Education Center and also for NISM-Equity Derivatives, Forex, Commodity, Mutual Funds Courses Coaching and Stock Market Classes in Hyderabad Telangana India. It become set up in 2004,