Check Box Objects


Check Box objects are a great way to enter data from a two-state control. Most people think of check boxes as a method of entering only Boolean data (that is, True and False). When the check box is checked, it is set to True; when it is unchecked, it is set to False. Check boxes in InfoPath can go beyond this simple implementation by allowing you to select both a different data type and values that should be passed when the check box is checked or unchecked.

To see this in action, drag a Check Box object onto a form, right-click the object, and select Properties from the right-click menu to open the dialog box shown in Figure 6-14.

click to expand
Figure 6-14: Check Box options

By default, when you add a Check Box object to your form using the on-the-fly method of form creation, the Data Type field will be set to True/False. You can set the Default State (in other words, whether the box is checked or cleared) and then specify what value should be passed along when either of these states occurs. This is the simplest way to use the check box, but you will find that if you change the Data Type field, you can actually set the values that will be passed when the check box is checked.

For example, in the dialog that is shown in Figure 6-15, a Check Box has been used to prompt the user for whether they want Priority Shipping for an extra $20. In this instance, regular shipping is only $10. The object has been set up so that the Unchecked state will pass a value of $10—if the user checks this option, the value of $30 is passed to the underlying data source or XML file. An example of how the properties for this object might look is shown in Figure 6-15.

click to expand
Figure 6-15: A check box used to enter

You can use check boxes with all different sorts of data types in the same manner—simply specify the values that will be passed when the option is checked or cleared.




How to Do Everything with Microsoft Office InfoPath 2003
How to Do Everything with Microsoft Office InfoPath 2003 (How to Do Everything)
ISBN: 0072231270
EAN: 2147483647
Year: 2006
Pages: 142

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