Date Picker Validation. RRS feed

  • Question

  • Hii there,,

    I am looking for a formula/code for validating the Date Picker control so that it cannot accept  any date that is more than one year(365 days) from Today or from a date that is specified on another Date Picker control. Anyone with an idea?

    Tuesday, February 28, 2012 8:51 AM


All replies

  • Hello,

    On the datepicker that you want to validate add a validation rule.  For the condition:

    datePickerField is greater than or equal to (select insert formula - see formula below):

    Insert a function > addDays.  For the first Insert Field, insert the "Today()" function.  For the second Insert Field type:  "365".  The formula should look like:

    addDays(Today(), "365")

    Then add your screentip.  Full condition will look like:

    datePickerField is greater than or equal to addDays(today(), "365)


    Tuesday, February 28, 2012 4:11 PM
  • Hi tegz07,

    There is no Validation Settings In SharePoint2007,it’s only in SharePoint2010.If use
    formula/code for validating the Date Picker control,   The correct syntax is:
    datePickerField <TODAY()+365 or = datePickerField < datePickerField1+365

    Also you can validate a datePickerField use javascript, here is a link about it:

    Examples of common formulas:

    Lhan Han
    Friday, March 2, 2012 9:15 AM
  • Hi Lhan,

    That's true for SharePoint list / library columns.  However, this is an InfoPath forum so we should assume that tegz is questioning date picker validation within an InfoPath form.



    Friday, March 2, 2012 1:17 PM