FORUMS


The Form Tools forums are no longer active, but the old posts have been archived here. Please see the Help page on how to get help / report issues.

Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Disable calendar in Date field (adding validation) or modify date range for pop up
#1
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?




Reply
#2
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.
Reply
#3
John,

Thanks for posting your solution.

Cheers,

Joe
Reply
#4
property for sale in budapest
Reply
#5
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.
Reply
#6
(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,
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)