throw validation errors on click of submit button - InfoPath Dev
in

InfoPath Dev

throw validation errors on click of submit button

Last post 06-18-2011 01:45 PM by Patrick Halstead. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 06-18-2011 12:44 PM

    throw validation errors on click of submit button

    Hi ,

     Can any1 please provide me any solution, how to show validation on click of submit button, I have infopath form, where user can add row to repeatable table, I have to do some validation programatically   on click of button       , I did validation and adding validation errors to error collection.

     " this.Errors.Add(root, "Validation Error", "Cannnot Submit form due to abscence of role with name " + ownerList[i]); " 

     It works fine, but it works only on client enabled infopath . But it does not work in browser enabled form. Can anyone tell me how to how show this validation error in browser based form.

    Some one has mention XDocument.ui.alert(), but i dont see any XDocument in Infopath form 2007 code behind. Im using C# has programmic logic. Please let me know solution ASAP

     

    -Mahender

  • 06-18-2011 01:45 PM In reply to

    Re: throw validation errors on click of submit button

    Hi Mahender,

    Dialog box popups arent supported in MOSS 2007 (nor 2010, I believe) so that won't work.

    You can use the error board though, so the code you are writing should add the error to the error board for your form and then you can use the default InfoPath validation errors (hover over, etc.) to show the user the issue but a dialog box won't work.

    May I suggest that you just use another section in your form that conditionally hides or shows based on whether there is an error. This can take the place of a dialog box - you just need to set the context to it, or do a switch view to show it and have a button to go back if your main view is long. Otherwise, just add the errors section to your main view close to the repeating table and then people will see it and fix the issue.

    Best of luck!

    Patrick Halstead
    Project Manager at Qdabra
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.