Problem with input validation on submit - InfoPath Dev
in

InfoPath Dev

Problem with input validation on submit

Last post 06-07-2012 12:49 AM by Patrick Halstead. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 06-04-2012 06:16 AM

    Problem with input validation on submit

    Hi,

    here's something I couldn't really solve so far:

    When clicking on a submit button in a form I often change the value of a status field. This value is used e.g. for conditional formatting to show/hide or write protect fields/sections in my forms.

    Now when a user e.g. forgets to fill out a required field and clicks on submit then the form is not saved and the user can add the required value. However, the rule that is set on the submit button has been executed, the value is changed and fields that shouldn't be displayed in the current status of the form are shown etc.

    I could set a condition for all required fields etc. for all rules on the submit button but this is pretty annoying. Also I have used a SharePoint Designer workflow to change a value since the workflow is executed after successful submitting of a form.

    Is there any better way to get the required functionality?

    Thanks for any ideas.

    Best regards, Bernhard

    Filed under:
  • 06-07-2012 12:49 AM In reply to

    Re: Problem with input validation on submit

    I suppose you could do a double submit and add the status field setting after the first submit which won't succeed if the form is invalid (therefore it won't get set). The second submit just submits the form again with the status field set. A bit of a kluge but probably easiest solution.

    Another random approach. If you're required fields have a special suffix (for example, reqField1,) you could use a fancy xpath to test them all without having to list them all. That won't work if your form is already in production (since it would require a data source change).

    You could also use our qRules plugin to get the errors and disable the Submit button if the number of errors is >0.

    Happy trails,

    P

    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.