Issue: By default the date picker will display the years as ±10 years. This is not suitable for a Date of Birth date picker.
Fix:
Fix:
- Edit the form in Nintex Forms.
- Double click the Date picker field.
- Open up the "Advanced" section.
- For setting "Store Client ID in JavaScript variable" change to "Yes".
- An additional field will be visible called "Client ID JavaScript variable name". Provide it a name. In my example it's called "birthdayControl".
- Click Save. Dialog will close.
- Click "NINTEX FORMS" on the ribbon.
- Click "Settings"
- Open up the "Custom JavaScript" section of the "Settings - Form" dialog.
- Add the following:
NWF$(document).ready(function(){
NWF$('#'+birthdayControl).datepicker('option',{yearRange:'-80:-0'});
});
- Change the variables to suit your situation:
- birthdayControl: Client ID Variable set in step 5 above.
- -80: How many years back you want to display in the date picker.
- -0:How many years forward you want to display in the date picker.
- Click "Save". Dialog will close.
- Publish the form.
- Your specific date control should now show a more appropriate year selection for Date of Birth.