Restrict date picker depending on a choice field - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Restrict date picker depending on a choice field

Last post 09-28-2017 08:02 AM by ChristinaGateley. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 09-27-2017 03:40 AM

    Restrict date picker depending on a choice field

     Hi, I hope someone is able to help.

     

    I have a date picker field that I would like to restrict depending on the result of another field.  For example:

     

    • I have a choice  field (Priority Rating) with 3 options: P1, P2, P3
    • Depending on which option is selected I would like to affect the date picker (Deferral Expiry Date) as follows:
      • P1 - disable people from being able to select a past date and also a date that is more than 365 days in the future
      • P2 - disable people from being able to select a past date and also a date that is more than 730 days in the future
      • P3 - disable people from being able to select a past date and also a date that is more than 1095 days in the future

     

    I've tried validating the date picker field but it's not really enabling me to do what I need to do.

     

    Thank you.

     Best wishes, 

    Filed under:
  • 09-27-2017 05:01 PM In reply to

    Re: Restrict date picker depending on a choice field

    I don't think you'll be able to restrict their ability to pick a date - however, you could run validation after the date has been entered. Is that acceptable?
    Hilary Stoupa

  • 09-28-2017 02:46 AM In reply to

    Re: Restrict date picker depending on a choice field

     Hi Hilary, thank you for answering my query.

     

    If it's not possible then I think that would be an acceptable solution.  Would I add 3 validation rules to the date picker? 

  • 09-28-2017 07:42 AM In reply to

    Re: Restrict date picker depending on a choice field

    Based on the logic you outlined, I'd actually use 4 rules - I'm attaching a simple sample. Right click the link in the post header, and save the file locally. Right click the saved file and select design - from there you can preview and try it out. :)
    Hilary Stoupa

  • 09-28-2017 08:02 AM In reply to

    Re: Restrict date picker depending on a choice field

    That is wonderful!  Thank you, Hilary, both for sharing your knowledge and your time :)

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