locked
Infopath 2013 User Friendly Message on Mandatory Fields Validation RRS feed

  • Question

  • Hi,

    I have an Infopath 2013 Form with almost 20 fields. All are mandatory. I had individually put "cannot be blank" check on all the controls. Now when user forgets to enter data in any of the field and clicks Submit, then Error message shown below is coming:-

    "The form cannot be submitted because it contains validation errors. Errors are marked with either a red asterisk (required fields) or a red, dashed border (invalid values). Field or group: my:txtEmpNameF Error: Cannot be blank "

    Instead I want a user friendly message . How can I achieve this ? I had gone through many posts and I cannot do custom code in my form. So please suggest an out of box method for this.

    Thanks,

    Tuesday, July 7, 2015 12:28 PM

Answers

All replies

  • Hi Shub- since there isn't a way to change that message, you have a couple options to get around it- 1. set up rules on the fields instead and create your own message for the rules. 2. Create a section with your own message in it and have your field rules trigger this section to open when rules aren't met. Note: you can also add these rules to the submit button to check the fields for information.

    cameron rautmann

    Tuesday, July 7, 2015 7:00 PM
  • Hi Cameron,

    Can you please elaborate point 2. If any example can be shown then it will be of great help.

    Thanks,

    Shub

    Wednesday, July 8, 2015 7:02 AM
  • I'm using InfoPath 2010, so things might be a little different on your end, but should be similar. Make sure you don't have any of the fields set as mandatory, as you're going to control that with this new method (that way you won't get the standard error message in InfoPath).

    Note: if you don't care about how your message looks, but just want to use your own message, then you can just use the out of the box custom message that comes with the rules you add to the fields. Then you won't need the section control.

    Steps for the section control:

    Add the control to your form:

    Type in the message that you want to appear when a field must be filled out:


    cameron rautmann

    Wednesday, July 8, 2015 12:57 PM
  • Set a formatting rule on the field so that if it's not blank, hide the section:


    cameron rautmann

    Wednesday, July 8, 2015 12:57 PM
  • Hi Cameron,

    I have set rules on Submit button to check if all required conditions are met. If not I will unhide my Section displaying a message. My form has almost 35 fields. Now the problem comes on Rules. When I am checking the Rules on Submit Button, I cannot check more than 5 controls under a single Rule.

    Please see the attachment for better understanding of my problem.Now I need to set almost 7 different rules to check my 35 fields.. Is there any other work around?

    Please suggest.

    Friday, July 10, 2015 5:45 AM
    • Marked as answer by Shubh_M Friday, July 17, 2015 6:47 AM
    Friday, July 10, 2015 12:06 PM
  • Hi Cameron,

    The work arounds are not working properly in my case. 

    I was going through another Infopath form on my SharePoint site (created by another person). I noticed that when I click SUBMIT on that form without filling Mandatory field, I got below message.

    "Infopath cannot submit the form because it contains errors. Errors are marked with either red asterisk or a red , dashed border . Use Ctrl + Shift + O to go to the next error . Use Ctrl + Shift+ I to view error details.  "

    This message is very user friendly than the message I am getting The form cannot be submitted because it contains validation errors. Errors are marked with either a red asterisk (required fields) or a red, dashed border (invalid values). Field or group: my:txtEmpNameF Error: Cannot be blank "

    Why my form is not showing the earlier message?

    Any Idea?

    Thanks

    Monday, July 13, 2015 6:35 AM