Tuesday, December 25, 2018

Submit form data under a certain condition

Submit form data under a certain condition

You can design your form template to allow users to submit forms that are based on your form template only if a certain condition is met in the form. For example, you might design an expense report form template that users can submit only if the expense total in the form is greater than a specified amount.

To accomplish this task, you configure the form template to allow users to submit the form, and then you add a rule that allows the form to be submitted only if a certain condition is met. After you add the rule, you can select which submit data connection to use if the condition in the rule is met.

When you configure your form template to allow users to submit their forms, Microsoft Office InfoPath adds a Submit button to the Standard toolbar and a Submit command to the File menu when users fill out the form.

When you configure the form template to allow users to submit their form data under a certain condition, you can also customize the submit options for your form template in the following ways:

  • Change the text that appears on the Submit button on the Standard toolbar and the Submit command on the File menu.

  • Change the keyboard shortcut for the Submit button on the Standard toolbar and the Submit command on the File menu.

  • Create custom messages to display to your users when they submit their forms.

  • Specify whether to leave the form open, close the form, or open another blank form after the form is submitted.

Add the rule to submit form data under a certain condition

  1. On the Tools menu, click Submit Options.

  2. In the Submit Options dialog box, select the Allow users to submit this form check box.

    Note: When you select this check box, InfoPath adds a Submit button to the Standard toolbar and a Submit command to the File menu when users fill out the form.

  3. Click Perform custom action using Rules, and then click Rules.

  4. In the Rules for Submitting Forms dialog box, click Add.

  5. In the Name box, type a name for this rule that describes the submit location. For example, if you want to allow users to submit the form by using an e-mail message only if the value in a specific field is greater than $50, type E-mail submit for over $50.

  6. In the Rule dialog box, click Set Condition.

  7. In the Condition dialog box, specify when the data connection should be used, and then click OK.

  8. In the Rule dialog box, click Add Action.

  9. In the Action list, click Submit using a data connection, click the data connection that you want to use for this submit action in the Data connection list, and then click OK.

  10. Click OK twice.

    1. To change the name of the Submit button that appears on the Standard toolbar and the Submit command that appears on the File menu when users fill out the form, type the new name in the Caption box in the Submit Options dialog box.

      Tip: If you want to assign a keyboard shortcut to this button and command, type an ampersand (&) before the character that you want to use as a keyboard shortcut. For example, to assign ALT+B as the keyboard shortcut for the Submit button and command, type Su&bmit.

  11. To prevent users from using the Submit command or the Submit button on the Standard toolbar when they fill out your form, clear the Show the Submit menu item and the Submit toolbar button check box.

    1. By default, after users submit a form, InfoPath keeps the form open and displays a message to indicate if the form was successfully submitted. To change this default behavior, click Advanced, and then do one of the following:

      • To close the form or create a new blank form after the user submits a completed form, click the option that you want in the After submit list.

      • To create a custom message to indicate if the form was successfully submitted, select the Use custom messages check box, and then type your messages in the On success and On failure boxes.

        Tip: Use a message in the On failure box to tell users what to do if they cannot submit their form. For example, you can suggest that users save their form and contact someone for further instructions.

      • If you do not want to display a message after the user submits a form, clear the Show success and failure messages check box.

No comments:

Post a Comment