Overriding validation possible when submitting a browser based form? - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Overriding validation possible when submitting a browser based form?

Last post 11-17-2008 10:01 PM by Anuma. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 10-22-2008 04:02 AM

    • Kousoku
    • Not Ranked
    • Joined on 10-22-2008
    • London, UK
    • Posts 5

    Overriding validation possible when submitting a browser based form?

    Hi all,

    I have found this forum very useful, being very new to Infopath, and have learnt a lot from other posts. I've tried to search for an answer to my question on here and have not been able to find anything. Hoping someone can help please?

    Basically, I have a browser based form which is launched from a Sharepoint site. I enable users to save the relatively long form in a Sharepoint library so that they can revisit it and complete it fully at a later stage.

    This is done by having a custom "Save" button which uses a data connection for submitting the form to a library with a default filename. (Ultimately, when they are ready to submit the completed form, the user can click a separate "Submit" button which submits the form to another library).

    Anyway, because I have validation on certain fields (e.g. Cannot be blank), when the user clicks on the custom "Save" button, it won't allow the user to save because obviously the "Save" button uses a submit action, which complains to the user that there are validation errors.

    Is there a way to override the validation on this particular submit action ("Save") and only have it in place for the proper submit action ("Submit")?

    Hope that all makes sense... Would appreciate any feedback.

    Thanks.

    Filed under: , , ,
  • 10-22-2008 05:11 AM In reply to

    Re: Overriding validation possible when submitting a browser based form?

    Hi,

    Use the following code in 'Save' button Onclick event. It overrides validations on 'Save' button.

    thisXDocument.Errors.DeleteAll();

  • 10-22-2008 06:38 AM In reply to

    • Kousoku
    • Not Ranked
    • Joined on 10-22-2008
    • London, UK
    • Posts 5

    Re: Overriding validation possible when submitting a browser based form?

    Thanks for the quick reply Santhosh.

    I forgot to mention I am using Infopath 2007 so thisXDocument does not exist. Would you possibly know how to achieve this in 2007?

    Thanks.

  • 10-22-2008 06:41 AM In reply to

    • Anuma
    • Top 25 Contributor
      Female
    • Joined on 07-20-2005
    • India
    • Posts 525

    Re: Overriding validation possible when submitting a browser based form?

    Hi,

     Use following code in infopath2007.

    this.Errors.DeleteAll();

     

    Anuma Chinthapalli /
    http://www.GGKTech.com
  • 11-14-2008 01:48 AM In reply to

    • Kousoku
    • Not Ranked
    • Joined on 10-22-2008
    • London, UK
    • Posts 5

    Re: Overriding validation possible when submitting a browser based form?

    Thanks Anuma,

    That worked great!

  • 11-17-2008 09:10 AM In reply to

    • ezack
    • Not Ranked
    • Joined on 04-04-2008
    • Posts 5

    Re: Overriding validation possible when submitting a browser based form?

     After you delete the Errors collection, how can it be reloaded?  For example, if the user hits the save button and continues working.  All the screen tips and * are gone...

  • 11-17-2008 10:01 PM In reply to

    • Anuma
    • Top 25 Contributor
      Female
    • Joined on 07-20-2005
    • India
    • Posts 525

    Re: Overriding validation possible when submitting a browser based form?

    Hi,

     

    First you need to get the parent node of the required fields or parent node of the form and replace the child nodes of that parent node.

     

    Anuma Chinthapalli /
    http://www.GGKTech.com
Page 1 of 1 (7 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.