Avoid saving a form if unvalid data - InfoPath Dev Sign in | Join | Help in Code InfoPath (Entire Site) InfoPath Dev InfoPath Dev is dedicated to bringing you the information and tools you need to be successful in your Microsoft Office InfoPath development projects. Home Blogs Forums Photos Downloads InfoPath Dev » InfoPath » Code » Avoid saving a form if unvalid data Avoid saving a form if unvalid data Last post 10-30-2007 01:55 PM by Greg Collins. 3 replies. Page 1 of 1 (4 items) Sort Posts: Oldest to newest Newest to oldest Previous Next 10-26-2007 06:27 AM zaphi Joined on 01-09-2006 Switzerland Posts 82 Avoid saving a form if unvalid data Reply Contact HiI would like to ask, if there is a possibility to check by code, if data validation is successfull or not. In my case, the form can be saved or sent, although some data are not valid, e.g. blank field.Thanks for your help. Best regards.Philippe Infopath 2007/SP2 10-29-2007 11:18 AM In reply to Greg Collins Joined on 08-08-2006 Posts 2,126 Re: Avoid saving a form if unvalid data Mark as Not AnswerMark as Answer... Reply Contact The DOM conatins an Errors object which allows you to determin whether there are any errors in the form. There's a Count property you can use. If the Count == 0, there's no errors. Please Visit:BraintroveGreg's Paintings 10-30-2007 02:21 AM In reply to zaphi Joined on 01-09-2006 Switzerland Posts 82 Re: Avoid saving a form if unvalid data Mark as Not AnswerMark as Answer... Reply Contact Hi Greg. Thanks a lot. I have tested with this code: if(XDocument.Errors.Count > 0) It works!Best regards. Philippe Infopath 2007/SP2 10-30-2007 01:55 PM In reply to Greg Collins Joined on 08-08-2006 Posts 2,126 Re: Avoid saving a form if unvalid data Mark as Not AnswerMark as Answer... Reply Contact Cool! Glad to have helped! Please Visit:BraintroveGreg's Paintings Page 1 of 1 (4 items) Copyright © 2003-2019 Qdabra Software. All rights reserved.View our Terms of Use.
HiI would like to ask, if there is a possibility to check by code, if data validation is successfull or not. In my case, the form can be saved or sent, although some data are not valid, e.g. blank field.Thanks for your help. Best regards.Philippe
The DOM conatins an Errors object which allows you to determin whether there are any errors in the form. There's a Count property you can use. If the Count == 0, there's no errors.
Hi Greg. Thanks a lot.
I have tested with this code: if(XDocument.Errors.Count > 0) It works!Best regards. Philippe
Cool! Glad to have helped!