How to validate a Date Range in Date control -Infopath 2010
-
Tuesday, May 03, 2011 4:12 AM
Hello All,
I have a issue in data range validation, please help
I am using Infopath2010 and developing a form where there are multiple sections. In each section I have a from date and to date controls.My requirement is to takecare the same date range should not fall in anyother sections.
SectionsA From date and to date / date range should not come in Section B From date and to date.
- Moved by Clayton CobbMVP, Moderator Wednesday, May 04, 2011 6:46 AM 2010 question (From:SharePoint - InfoPath Forms Services (pre-SharePoint 2010))
Answers
-
Wednesday, May 04, 2011 3:18 AMModerator
Hi Janidbest,
Thanks for your post.
As I understand, you want to validate the date controls in different sections, am I right?
You can try to achieve this by programming. Write the validate logic in the submit event.
Here is a post about Custom field validation in InfoPath.
http://mundeep.wordpress.com/2009/05/20/infopath-2007-custom-field-validation/
More information:
http://msdn.microsoft.com/en-us/library/bb294378(v=office.12).aspx
http://msdn.microsoft.com/en-us/library/bb229711(v=office.12).aspx
- Edited by Wayne FanModerator Wednesday, May 04, 2011 6:49 AM delete some links
- Marked As Answer by Wayne FanModerator Thursday, May 12, 2011 5:39 AM
-
Wednesday, May 04, 2011 6:46 AMModerator
This is the pre-2010 forum, but your question is about 2010. Please use the correct forum in the future.
There is no simple way to do this. It may be possible without code, but you'd have to add complex data validation rules, and I can't even think of a possible way to do that.
SharePoint Architect || Microsoft MVP || My Blog
Planet Technologies || SharePoint Task Force- Marked As Answer by Wayne FanModerator Thursday, May 12, 2011 5:39 AM
-
Wednesday, May 04, 2011 3:58 PM
OK I went crazy and took on the challenge:
Inspired by the InfoPath Codeless Warrior, I combined:
http://alecpojidaev.wordpress.com/2008/12/30/infopath-codeless-programming-walkthrough-2/
and a bit of Preceding rule
http://johnliu.net/blog/2011/3/24/infopath-using-preceding-xpath-expression-to-hide-repeating.html
Result:
http://johnliu.net/blog/2011/5/4/infopath-rule-based-repeating-section-date-validation.html
jliu - johnliu.net - sharepointgurus.net- Marked As Answer by Wayne FanModerator Thursday, May 12, 2011 5:39 AM
All Replies
-
Tuesday, May 03, 2011 6:39 AM
Hello All,
I have a issue in data range validation, please help
I am using Infopath2010 and developing a form where there are multiple sections. In each section I have a from date and to date controls.My requirement is to takecare the same date range should not fall in anyother sections.
SectionsA From date and to date / date range should not come in Section B From date and to date.
Can some one answer please... -
Wednesday, May 04, 2011 3:18 AMModerator
Hi Janidbest,
Thanks for your post.
As I understand, you want to validate the date controls in different sections, am I right?
You can try to achieve this by programming. Write the validate logic in the submit event.
Here is a post about Custom field validation in InfoPath.
http://mundeep.wordpress.com/2009/05/20/infopath-2007-custom-field-validation/
More information:
http://msdn.microsoft.com/en-us/library/bb294378(v=office.12).aspx
http://msdn.microsoft.com/en-us/library/bb229711(v=office.12).aspx
- Edited by Wayne FanModerator Wednesday, May 04, 2011 6:49 AM delete some links
- Marked As Answer by Wayne FanModerator Thursday, May 12, 2011 5:39 AM
-
Wednesday, May 04, 2011 3:59 AM
Hi Wayne,
Thanks for the reply.
Actually I'm new to Infopath, not sure how to write a code in Infopath, Iam a dotnet developer and very much familiar with C# coding, eventhough the way of coding in Infopath differs than the regular coding.I didn't find any good book/ articles on this.If i write a code dont knw how do i deploy it/host it. Is not a simple approach that doing the same in control validation it self.. something like using functions adddays() or anyother...was expecitng to solve the issue with simple approach instead of making it complex. can you pls guide..
-
Wednesday, May 04, 2011 6:46 AMModerator
This is the pre-2010 forum, but your question is about 2010. Please use the correct forum in the future.
There is no simple way to do this. It may be possible without code, but you'd have to add complex data validation rules, and I can't even think of a possible way to do that.
SharePoint Architect || Microsoft MVP || My Blog
Planet Technologies || SharePoint Task Force- Marked As Answer by Wayne FanModerator Thursday, May 12, 2011 5:39 AM
-
Wednesday, May 04, 2011 3:58 PM
OK I went crazy and took on the challenge:
Inspired by the InfoPath Codeless Warrior, I combined:
http://alecpojidaev.wordpress.com/2008/12/30/infopath-codeless-programming-walkthrough-2/
and a bit of Preceding rule
http://johnliu.net/blog/2011/3/24/infopath-using-preceding-xpath-expression-to-hide-repeating.html
Result:
http://johnliu.net/blog/2011/5/4/infopath-rule-based-repeating-section-date-validation.html
jliu - johnliu.net - sharepointgurus.net- Marked As Answer by Wayne FanModerator Thursday, May 12, 2011 5:39 AM

