cforms II User Forum

Registration is currently disabled.
Guest

FAQs

Login form protected by Login LockDown.


Lost password?
Advanced Search

— Forum Scope —

  

— Match —

   

— Forum Options —

    

Wildcard usage:
*  matches any number of characters    %  matches exactly one character

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
Where to change datepicker yearRange?
March 11, 2012
3:05 pm
Oliver
Guest

I would like to use the datepicker to enter a birthday. But it's not possible with a year range of +/- 10 years!

So where to change datepicker yearRange maybe to

yearRange: "-80:+0"

?

Thanks,

Oliver

March 12, 2012
7:07 am
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

right, for now you'll have to hard-code this in cforms.php, just search for >>

 

changeYear: cfCAL.changeYear,

 

and add you custom code, eg.:

 

[...] yearRange: "-80:+0", changeYear: cfCAL.changeYear, [...]

July 10, 2012
2:16 am
Rab
Guest

Hi Oliver,

Could an option for this be added at some point? Perhaps within the options for the field itself?

Cheers,

Rab

July 10, 2012
6:10 am
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

Yes, it's on the list.

August 15, 2012
7:08 pm
Olli
Guest

Oliver said
right, for now you'll have to hard-code this in cforms.php, just search for >>

changeYear: cfCAL.changeYear,

and add you custom code, eg.:

[...] yearRange: "-80:+0", changeYear: cfCAL.changeYear, [...]

Hi Oliver,

Thanks for your hint – it worked fine, but I found a little bug. I set the year range to "-80:-11" to set the min. age to 11. The datepicker pops-up with default year 1932. So far, so good, but if you do not select a year and just select a day and a month, the datepicker will enter the correct day and month into the field but the year will be 2012.

Best regards, Oliver

Forum Timezone: Europe/Berlin

Most Users Ever Online: 959

Currently Online:
27 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

tracedef: 43

mores: 21

Gyrus: 20

frozenwaste: 18

asuffredini: 15

photoworks: 14

Member Stats:

Guest Posters: 3744

Members: 1463

Moderators: 3

Admins: 2

Forum Stats:

Groups: 1

Forums: 4

Topics: 5344

Posts: 18713

Newest Members: juredujmovic, dreamkeeper, rajattyagi, wrokaa, lukass

Moderators: Paul (421), cnymike (8), sonika (95)

Administrators: Oliver (6400), Nicky (3)