Invalid Date Validation - InfoPath Dev
in

InfoPath Dev

Invalid Date Validation

Last post 03-26-2007 06:24 AM by soshan. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 03-24-2007 07:22 AM

    • soshan
    • Not Ranked
    • Joined on 03-24-2007
    • India
    • Posts 5

    Invalid Date Validation

    Hi,
    I'm a newbie to Infopath forms. I have a date field in my form, wherein the user can enter a date having some conditions. We have a requirement in which we need to disable some invalid dates as well as set a range of valid date values [e.g Date values can be entered from 'current year - 10 years' to 'current year + 10 years']. Is there a manner in which I can disable some dates in the date picker for an infopath form?
    Thanks in advance.
    -Soshan.
  • 03-24-2007 07:36 AM In reply to

    Re: Invalid Date Validation

    Hi Soshan and welcome to the forums!

    There is no easy way to disable certain dates from being input like you want, but you can do this with code. To do this, double-click the date field, go to Data Validation tab, select OnBeforeChange event at the bottom, and then click edit form code. Insert code here (using examples found from searching this forum) to read the date that the user inserted. If it is not in the right time range, then add an error to the node and/or clear the value. Make sure to pop up a message letting the user know what you're doing.

    You will probably want to add a note in your form to tell the users the dates they cannot enter.
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 03-26-2007 06:24 AM In reply to

    • soshan
    • Not Ranked
    • Joined on 03-24-2007
    • India
    • Posts 5

    Re: Invalid Date Validation

    Thanks for your help!!!
    Really appreciate it.
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.