Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Confiforms date picker validation to prevent users from picking days in the past

Curtis Freudigmann March 29, 2019

As the title suggests I am looking for a way to prevent my users from selecting a date before the current day in a date picker in a Confiforms form. I know that there is an option to add regex. Has anyone tried this? Any suggestions would be appreciated.

Thanks!

-Curtis

2 answers

1 accepted

0 votes
Answer accepted
Alex Medved _ConfiForms_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 29, 2019

You cannot modify the date picker itself, but you can setup the validation rule for your form to accept the dates after the certain date

This page demoes the concept and accepts the dates after today

Curtis Freudigmann April 1, 2019

Hey Alex! I was able to follow the link and get the example form in to my space. I have the validation working and it sends my error message. The issue I am facing now is that my forms have multiple date pickers. Certain date pickers are only shown when other fields are selected. For example: I have a normal request and a miscellaneous request in the same form. the fields differ depending on if Normal or Miscellaneous is selected in the drop down. If the user selects Normal, and fills out all accompanying information the form will not submit because the date picker in Miscellaneous is not passing validation because the empty picker is not showing as a date in the future. Am I able to set multiple conditions? Or would I need to set up an extra rule somehow?

As always thanks for the great responses!

-Curtis

Alex Medved _ConfiForms_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 1, 2019

Well, just tune the condition in the rule to only apply when necessary

Meaning something like -  when the selection in some other field matches some value and the date is not empty and not after "today" then show the error message

For example, like is shown here - we only "require" field value when the other field is checked

Curtis Freudigmann April 1, 2019

Thanks Alex! I was trying && instead of AND which was not working. I made this simple correction and it works as expected. 👍

Curtis Freudigmann May 20, 2019

Hey Alex, I am working on something very similar to this but have ran in to small snag. I need to let users select a date that is today and forward. Using the mydate:<[now], the user has to go in and move the clock to a minute ahead to all them to pass the validation. Is there a way to set something like mydate:<[now]-1 minute.? That way I can set [now] as the default starting interval and still pass validation.

Please let me know. Thanks!

-Curtis

Alex Medved _ConfiForms_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 21, 2019
Curtis Freudigmann May 21, 2019

This works exactly as I was hoping. Thanks Alex!

0 votes
Ross Strachan March 8, 2021

I just cannot get this to work......Field is called Desired Launch Date

Set the validation on the field to DesiredLaunchDate:<[entry._today]

Added a validation defition and set that to the same DesiredLaunchDate:<[entry._today]

 

Still lets me pick any date I want.   Clearly i'm misunderstanding and doing something wrong.

:(

Alex Medved _ConfiForms_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 8, 2021

Hi

You cannot prevent this in UI, but you can validate the data submitted and prevent this from being submitted

Have you set this as a condition in your ConfiForms Field Definition Rule?

Have you also selected action to be "validate" and defined the message to show when the validation fails?

Alex

Ross Strachan March 10, 2021

So on the field, I have validation set to DesiredLaunchDate:<[now] on the field - no separate field definition rule.

But this fails ALL the time. I can't pick any date.  I just want to block future dates.

Do I need to use the additional field definition rule?

Ross Strachan March 10, 2021

Ah - that was my issue - its working now!  Thanks for you help!!!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events