Best Practices

 View Only
  • 1.  Date field with data selection in the past and today

    Adopter
    Posted 09-17-2021 11:34
      |   view attached

    Prontoforms has the range validation NONE, IN THE PAST and IN THE FUTURE.
    • If we add the range validation IN THE PAST, the user cannot select TODAY as date.

    This is not good for our business. Today we work with range validation NONE and our technicians can add a date in the future, which is not good.

    Please implement this new functionality in the product team.

    Thank you for your support.

    ------------------------------
    Diego Martinez
    IT Business Analyst Aftersales
    SIG Information Technology GmbH
    ------------------------------


  • 2.  RE: Date field with data selection in the past and today

    Posted 09-17-2021 15:59
    Edited by Ravneek Kaur 09-17-2021 16:02
    Hi Diego, there are a couple of workarounds that can help you achieve this:

    1. You can opt to use conditional logic to validate the date instead of applying validation on the question itself.
    So, add two date selector questions in the form, say Date 1 and Date 2. Date 2 will be hidden and automatically set to today's date (Page Start, Record Start, etc.). Your conditional logic statement will compare the values of the two date selector questions. If the value entered is greater than Date 2 (in other words, if it's in the future), then show a read-only and required field to notify the user that they will need to update their date in order to proceed.

    2. Another method is to simply use a "Date/Time" selector question instead of just Date as it allows you to select today's date and the present time even if the validation is set to past.
    Hope this helps!
    Thank you,
    Ravneek


    ------------------------------
    Ravneek Kaur
    Product Manager
    ProntoForms
    ------------------------------



  • 3.  RE: Date field with data selection in the past and today

    Posted 09-17-2021 16:01

    Hey Diego, 

    You can accomplish this by using Conditional Logic and ReadOnly Required questions (if you need to completely stop a submission if the date is in the future)

    What you can do is create a hidden date/time field that defaults at Page Start. Then you can have your 2nd date question where your user will actually pick the date/time. 

    Using Conditional Logic you can check if one date is greater or less than the other (Indicating if its in the future or the past respectively) I did a quick little mock up of what that would look like in the form. Below you can see my 2 date/time questions, the first one is the one that is defaulting to Page Start and the second is User Input. 

    The conditional logic rule is evaluating whether the Date that was input is greater than the date/time now, and if it is make that read only required question visible so that it blocks the ability to submit without correcting the issue first. 


    In the form, if I try to select a date that is in the future then I will be blocked from submitting: 

    I hope this helps and if you require any clarification on this, please do let me know! 


    ------------------------------
    Ian Chamberlain
    Implementation Specialist
    ProntoForms
    ------------------------------



Reminder: Content posted to our Community is public content.  Please be careful not to post Intellectual Property that you do not have permission to share.  For more information please refer to our Terms Of Use