Validating End Date from Start Date - InfoPath Dev
in

InfoPath Dev

Validating End Date from Start Date

Last post 09-08-2015 04:26 PM by donstephen. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 08-31-2015 06:37 PM

    Validating End Date from Start Date

     I have a form where I would like to prevent user from selecting a end date that is more then one year from the start date (InfoPath 2013)?  Any suggestion would help.  Thanks

    Filed under: ,
  • 09-06-2015 11:46 PM In reply to

    Re: Validating End Date from Start Date

    Hi Benny,

    Could you try adding a validation rule at the EndDate field with the following formula for the condition:

    click condition and select "The expression" from the first dropdown control, be sure to replace the xpath for StartDate with the correct one.

    . > xdDate:AddDays(../my:StartDate, "365") and . != ""

    The condition woud look similar to this after adding:

    EndDate > addDays(StartDate, "365") and
    EndDate is not blank

    This way, if the EndDate is greater that StartDate + 365 days, a validation error will appear.

    I hope this was clear enough. Please let us know if this doesn't work for you.

    Regards,

     

      

     

     

    Don Stephen Lambatin / Support Engineer
    Qdabra Software
  • 09-08-2015 10:34 AM In reply to

    Re: Validating End Date from Start Date

     Thanks Don,

     Worked perfectly.   

  • 09-08-2015 04:26 PM In reply to

    Re: Validating End Date from Start Date

    Glad I could help. Cheers!

    Don Stephen Lambatin / Support Engineer
    Qdabra Software
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.