Limit date selection in date field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-23-2017 06:28 AM
I would like to set up a date field (variable name: "access_expiration_date") so that if a user tries to select a date greater than six months from the current date, they will get an error message. I would imagine this is an easy script to write, but I'm a fairly new admin and I'm not quite sure how to do it.
Thanks!
Vince
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-28-2017 11:57 PM
Did you manage to address this issue ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-30-2017 06:10 AM
No, I'm still working on it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-29-2017 01:33 AM
Hi Vince,
I would rather suggest you to use UI policy than a client script because of the execution order in which they both run, UI Policy runs first.
Here is the way to achieve your requirement,
Create a new UI policy on the date field as below :
Click on the advance checkbox, in the script part write the following code :
function onCondition() {
alert('End date cannot 6 months from current date');
g_form.setValue('u_end_date','');
}
Let me know if you need any further help on this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-29-2017 11:06 AM
How will that code only limit selection to Tuesday's and Thursdays?
Thanks,
Vince
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-29-2017 10:51 PM
Vince,
This won't. I thought requirement was only a validation over a period of 6 months.
You will need to go with a onChange client script if you want selection only on Tuesdays and Thursdays. Add 180 days to the current date and check the day of the week if it's not Tuesday or Thursday alert a popup.
