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:
- Position your cursor where you want to insert the button.
- 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.
- Under Insert controls, click Button.
The button appears on the form:
- Double-click the button to open the Button Properties dialog.
- If necessary, enter a label for the button, such as “Submit”.
- 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.
- 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.
- 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.
- To define how the form responds to the submit action, click the Submit Options button.
- 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.
- Specify what kind of message to give users after the data is submitted.
- Click OK to close the Submit Options dialog.
- Click OK to close the Submitting Forms dialog.
- 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