Microsoft Office

Microsoft Infopath Tutorial and Online Training Course

Adding buttons to your form

Buttons are used to give users the ability to perform actions on forms, such as submitting data to a database, creating new records, and submitting search queries. InfoPath includes some standard buttons, and also provides you with the ability to write custom scripts for a button using the Microsoft Script Editor.

The button control appears in the list on the Controls task pane. To insert a button:

  1. Position your cursor where you want to insert the button.
  2. If necessary, return to the Controls task pane by selecting Controls from the task pane menu or clicking Controls on the Data Source task pane.
  3. Under Insert controls, click Button.

The button appears on the form:

  1. Double-click the button to open the Button Properties dialog.

  1. If necessary, enter a label for the button, such as “Submit”.
  2. From the Action drop-down menu, select Submit to have the button submit the data on the form, or Script if you want the button to perform a custom action.
  3. For a script, click Microsoft Script Editor to write the script. Make sure the correct script ID appears in the field in the Button Properties dialog.

If you select Submit, the Submitting Forms dialog opens:

Here, select the Enable submit option.

  1. Under Submit, select how you want to submit the form. You can submit the data to a Web service, a web site address, or using a custom script.

Note:

If your form is connected to a database, InfoPath includes a Submit to a database option in the Submitting Forms dialog. This handles the submission of data to the database automatically.

  1. To define how the form responds to the submit action, click the Submit Options button.
  2. In the Submit Options dialog, choose an option for the form—you can close it, create a new form, or leave the current form open.

  1. Specify what kind of message to give users after the data is submitted.
  2. Click OK to close the Submit Options dialog.
  3. Click OK to close the Submitting Forms dialog.
  4. Click OK to close the Button Properties dialog.

Microsoft InfoPath Tutorial: Section 6 Review

In this section, you learned about:

  • Customizing Controls
  • Adding a validation rule
  • Binding controls
  • Populating controls from a data source
  • Adding buttons to your form