Limiting Dates in Date Picker - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Limiting Dates in Date Picker

Last post 05-30-2014 08:48 AM by snturner. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 04-11-2014 12:28 PM

    Limiting Dates in Date Picker

    I am attempting to limit the available selection of Days in the date picker and can not find any information on how to accomplish it.  I need the picker to only allow users to select a date three business days after the date of submission.

     So for example if they are filling out the form Friday, April 11, 2014, I do not want them to be able to pick any days prior to Wednesday, April 16th.  Is that possible?

     I have seen some posts about limiting the picker to only be able to select business days, but none on how the limit the first three days.

  • 04-13-2014 04:48 PM In reply to

    Re: Limiting Dates in Date Picker

    Hi ander2cc,

    Welcome to InfoPathDev.

    I would suggest adding a Validation Rule where the condition is EndDate < addDays(StartDate, 3), then set a Screen Tip message. This would prevent the user from selecting days prior to the start date and less than three days after the start date by showing a validation error. Please let me know if this helps.

    Regards,

    Don Stephen Lambatin / Support Engineer
    Qdabra Software
  • 04-14-2014 05:58 AM In reply to

    Re: Limiting Dates in Date Picker

    That worked fantastically thank you. 

  • 04-14-2014 11:07 AM In reply to

    Re: Limiting Dates in Date Picker

    If the forms with this validation get opened and saved at a later time, you may want to add another field to prevent the validation from running.

    Ex:  First time use, the user puts 6 days from now, but someone opens the form 4 days from now, the validation on that field will not allow them to save the form without fixing the date.

    If you don't have to worry about that type of event occuring, then the validation works perfectly.

    If you do or can have someone open the form at a later date and resave, you may want to add another field, a boolean field (true/false) that is defaulted to false and changes to true when the form gets submitted.
    The validation for the due date should check that boolean field to see if it is false.  If it is false, the validation would run.
    Once the form is submitted, the validation won't run since the boolean field is true.

  • 05-29-2014 10:17 AM In reply to

    Re: Limiting Dates in Date Picker

    Don, can you explain this formula to me? Where does EndDate and StartDate come from? I am thinking EndDate is a variable created for the formula and StartDate is the date the user entered. Correct? If so I can’t get it to work.

     

  • 05-29-2014 06:56 PM In reply to

    Re: Limiting Dates in Date Picker

    Hi snturner,

    Both EndDate and StartDate are fields from the form displayed on the canvas. What was needed here was a formula to prevent the user from selecting a date 3 days after the start date.

    If user selects May 29 (for the StartDate field), the Validation formula added to the EndDate field will show a validation error if the user selects May 30.

    Hope this helps.

    Don Stephen Lambatin / Support Engineer
    Qdabra Software
  • 05-30-2014 08:48 AM In reply to

    Re: Limiting Dates in Date Picker

    Thank you, makes sense now.

Page 1 of 1 (7 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.