how to check if there are validation errors in the Infopath form?

Posted on 2011-05-06
Last Modified: 2012-05-11
Hi All,

Does anyone know how to check if there are any data validation errors in the form using Code? Each field of my form is checked against incorrect formatting using Data Validation feature - when there is a problem field is marked in red and error message appears... I've also disabled default Submit button and programmed my own but I need to find the way to check if all fields are filled in correctly before the form is sent - any ideas?


Question by:fortres
    LVL 28

    Accepted Solution

    This has to be done manually to my knowledge, right code to conditionally check each value or put a rule on each field to flag a validation field if it does not validate. Then you have a master validation flag.

    The default validation is pretty limited practically since you have to rely on the user to see it and often some fields may not be exposed when submitting.

    So I typically use my own rules and checks to manage the form is complete either on the submit or beforehand.

    Author Comment

    Hi Clayfox

     "rule on each field to flat a validation field"  -of course!  I was so focused on Data Validation that I forgot about simple rules - thanks mate!


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Article by: Ivo
    C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
    This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
    This video discusses moving either the default database or any database to a new volume.
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now