The Button Control

 <  Day Day Up  >  

Button controls are likely to be familiar to you from HTML forms. Button controls in InfoPath have a useful OnClick event, as scripting code can be written to respond to that event. They are therefore very important controls in InfoPath 2003, because no other form controls have an associated event that responds directly to user interaction. The General tab of the Button Properties window contains the most important properties.

From the Action drop-down menu, select whether you want the button control to submit the data, or whether you want to add script code to the button control.

USE FRIENDLY SCRIPT IDs ON BUTTON CONTROLS

The default script IDs offered on button controls are pretty meaningless to the human eye. For example, in an extensive form script, the ID CTRL22_5 doesn't tell you much about the button to which it refers. I suggest, therefore, that you take time to alter the script ID for any button control that you plan to script to a more friendly name .

You must be careful to create the human-friendly script ID before creating any script for that button control, because the scriptID in the Microsoft Script Editor doesn't update automatically. Alternatively, you can hand-edit any change made to the script ID in the Microsoft Script Editor after script code has been created.


In the Label text box, provide a meaningful label for the button to help the user understand its function. To ease scripting for yourself or for a developer who has to maintain your code, provide a meaningful name for the button control in the Script ID text box.

The button control was demonstrated in Chapter 1, "Getting Started with InfoPath." The OnClick event is discussed in Chapter 19, "Events in InfoPath."

To learn more about the OnClick event, see "The OnClick Event," p. 343 (Chapter 19).


 <  Day Day Up  >  


Microsoft Office InfoPath 2003 Kick Start
Microsoft Office InfoPath 2003 Kick Start
ISBN: 067232623X
EAN: 2147483647
Year: 2004
Pages: 206

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net