close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Date picker doesnt allow earlier than 1999

Thread began 9/17/2009 10:28 am by Dipo | Last modified 12/21/2009 1:27 pm by Jimmy Wu | 2743 views | 10 replies |

Dipo

Date picker doesnt allow earlier than 1999

I'm using Form Builder to build an application form that would require the user to enter his/her date of birth. The date picker only allows between 1999 -2019. Where do I go to change this values? I need to be able to select as early as 1901 if possible.

Sign in to reply to this post

Jimmy Wu

The drop down initially shows a range of 20 years. Once you select an earlier year, the range changes to display earlier years with the year you choose to be the middle value. That is why it shows 1999-2019 initially, since it uses today's date as a default.

to display the date range to be what you want find this block of code in page you've applied the form to:
$(function(){
$('#fieldset_group_field').datepicker({
changeMonth: true,
changeYear: true,
onClose: closeDatePicker_fieldset_group_field
});
});

At this point you have an option of what you can do. After the line:
changeYear: true,

You can add either of these lines in:
yearRange: "1901:2009",

or

yearRange: "-108:+0",

The first one is a hardcoded date range, whereas the second one will change the date range as time progresses.


Here's a reference for if you want to change anything else on the Date Field:
datepicker/

Sign in to reply to this post

Dipo

Thanks this works perfectly.
Is there a way to change the date format? Right now its mm/dd/yyyy; I'd like to change it to dd/mm/yyyy.

Sign in to reply to this post

Jimmy Wu

In the same block of code under the yearRange you can add:
dateFormat: 'dd/mm/yy',

Sign in to reply to this post

Dipo

Thanks for the prompt reply.
I added the code to change the date format but the form validation now throws up an 'invalid format' error; I entered Form Builder to edit the form and unchecked the required checkbox to remove the validation but somehow the error validation remains.

Sign in to reply to this post

Jimmy Wu

I'm not sure why the validations are firing. What you can test is to create a new page and create a form with just a date field in it and make the modifications to that to see if it may be something else interfering with the validations?

I just tried it on my end and did not get the validations to fire when the date format was changed.

Sign in to reply to this post

whit368229

Datepicker and more

Originally Said By: Jimmy Wu
  Here's a reference for if you want to change anything else on the Date Field: datepicker/  



Thanks for that post Jimmy! ALL my questions were answered there! That's a gold mine of information.
--

whit

Sign in to reply to this post

Jimmy Wu

Glad it was helpful. If you have any additional issues, feel free to open a new forum thread.

Sign in to reply to this post

DarylBeta Tester

I have tried adding;

yearRange: "-108:+0",

to the two datepickers on my web page but I can still pick dates in the future.

Any ideas?

Sign in to reply to this post

DarylBeta Tester

After a bit of fiddling I had to use;

minDate: -100, maxDate: '+0',
Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...