How to use custom date pattern? - InfoPath Dev
in

InfoPath Dev

How to use custom date pattern?

Last post 12-21-2011 08:45 AM by Jimmy. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 12-21-2011 01:28 AM

    How to use custom date pattern?

    Hi All,

    I need to validate text box for date field. We can not use date field since there are too many date fields on the form and it has exceeded the 48 date column limit.

    I am developing infopath 2010 form based on sharepoint list template. The validation rule needs to validate date for dd/mm/yyyy or mm/dd/yyyy but I am not able to get the pattern (Reg. expression) for this.

    Most of the times it says like invalid pattern. Is infopath pattern different than regular expression? I appreciate your suggestions.

    Thanks,

    Rahul Babar

     

    ================================================
    ASP.NET, C#, Sharepoint 2007/2010/2013/SP Online, Infopath 2007/2010/2013 Admin/Developer
  • 12-21-2011 08:45 AM In reply to

    Re: How to use custom date pattern?

    I believe the pattern you're looking for is this:

    \d\d/\d\d/\d\d\d\d

    That will ensure that the value is 2 digits, then a slash, 2 more digits, another slash, and then 4 more digits.  This means that something like 33/45/6789 would still be treated as valid, but I think that's about the best you can do in this situation.  Frankly, this sounds like a bad idea.  Allowing the months and days to be in order sounds especially crazy.  If you have that many fields, maybe it would make sense to move to a non-list form, which has less limitations?

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.