Input scopes for InfoPath controls
In this article
Introduction to input scopes
If you want to improve the recognition of non-keyboard text input in a control, such as text that is entered into a text box with a tablet pen, you can specify an input scope for the control. An input scope enables you to specify the type of user input that is intended for the control. For example, if you use the IS_URL input scope for a text box, any spaces that are entered between words are ignored.
An input scope can be set for the following types of controls:
-
Text box
-
Rich text box
-
Date picker
-
Bulleted list
-
Numbered list
-
Plain list
-
Combo box
-
Multiple-selection list box
To specify an input scope, double-click the control. In the Control Properties dialog box, click the Advanced tab, and then click Input Scope.
Types of input scopes
There are three types of input scopes:
All types of input scopes can be configured to restrict input to match only the specified input scope pattern or to just bias input toward that pattern. By default, an input scope is restricted to match only the input scope pattern. To allow non-matching input, but still bias toward the input scope, select the Recognize non-matching input check box in the Input Scope dialog box.
Notes:
-
An input scope applies only to the control on which it is set, not to the field to which the control is bound.
-
The input scopes feature does not work with East Asian language recognizers.
The following sections describe each type of input scope.
Standard
To set a standard input scope, click Standard in the Input Scope dialog box, and then click the setting in the Input scope list. The following table describes the pattern defined for each standard input scope and provides an example of the kind of input to which it is intended to apply.
Input Scope | Description |
IS_DEFAULT | Standard recognition bias. Treated as the default and utilizes the default lexicon (vocabulary). |
IS_URL | URL, File, and FTP formats. Examples:
|
IS_FILE_FULLFILEPATH | Characters used in describing a file path. Includes the following conditions:
Examples:
|
IS_FILE_FILENAME | Characters used in describing a file name. Includes the following conditions:
Examples:
|
IS_EMAIL_USERNAME | E-mail user names. Examples:
|
IS_EMAIL_SMTPEMAILADDRESS | Complete SMTP email address. For example, someone@example.com. |
IS_LOGINNAME | Login name and domain. Includes the following conditions:
Examples:
|
IS_PERSONALNAME_FULLNAME | Combinations of first, middle, and last names. Examples, formatted for English (United States):
|
IS_PERSONALNAME_PREFIX | Honorific or title preceding a name. Examples, formatted for English (United States):
|
IS_PERSONALNAME_GIVENNAME | First name or initial. Examples, formatted for English (United States):
|
IS_PERSONALNAME_MIDDLENAME | Middle name or initial. Examples:
|
IS_PERSONALNAME_SURNAME | Last name. Examples, formatted for English (United States):
|
IS_PERSONALNAME_SUFFIX | Name suffix, abbreviations, and Roman numerals. For example, Jr. |
IS_ADDRESS_FULLPOSTALADDRESS | Full address, including numbers. Examples, formatted for English (United States):
|
IS_ADDRESS_POSTALCODE | Alphanumeric (for international support) postal code. Examples, formatted for English (United States):
|
IS_ADDRESS_STREET | House number, street number, apartment name and number, and postal box only. For example, 123 Main Street. |
IS_ADDRESS_STATEORPROVINCE | Full name or abbreviation of state or province. Examples, formatted for English (United States):
|
IS_ADDRESS_CITY | Name or abbreviation of city. Examples, formatted for English (United States):
|
IS_ADDRESS_COUNTRYNAME | Name of Country. Examples, formatted for English (United States):
|
IS_ADDRESS_COUNTRYSHORTNAME | Abbreviation for country. Examples, formatted for English (United States):
|
IS_CURRENCY_AMOUNTANDSYMBOL | Currency symbols and numbers. Examples, formatted for English (United States):
|
IS_CURRENCY_AMOUNT | Numeric values for currency, excluding currency symbols. For example, 2,100.25. |
IS_DATE_FULLDATE | Full date, in a variety of formats. Examples, formatted for English (United States):
|
IS_DATE_MONTH | Numeric representation of months, constrained to 1-12. Examples:
|
IS_DATE_DAY | Numeric representation of days, constrained to 1-31. Examples:
|
IS_DATE_YEAR | Numeric representation of years. Examples:
|
IS_DATE_MONTHNAME | Character representation of months. Examples, formatted for English (United States):
|
IS_DATE_DAYNAME | Character representation of days. Examples, formatted for English (United States):
|
IS_DIGITS | Positive whole numbers. Digit strings made of 0-9 are allowed. |
IS_NUMBER | Numbers, including commas, negative sign, and decimal. For United States locations, includes the following conditions:
|
IS_ONECHAR | A single ANSI character, codepage 1252. For United States locations, this includes the following characters: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdEfghijklmnopqrstuvwxyz0123456789!\"#$%&'()*+,-./:;<=>?@[\]^_`{|}~ |
IS_TELEPHONE_FULLTELEPHONENUMBER | Telephone number. Does not support numbers with letters. Examples, formatted for English (United States):
|
IS_TELEPHONE_COUNTRYCODE | Telephone country codes. Examples, formatted for English (United States):
|
IS_TELEPHONE_AREACODE | Telephone area codes. Examples, formatted for English (United States):
|
IS_TELEPHONE_LOCALNUMBER | Telephone number, excluding country or area code. Examples, formatted for English (United States):
|
IS_TIME_FULLTIME | Hours, minutes, seconds, and alphabetic time abbreviations. US English uses the 12 hour clock. Leading zeros are optional for hours but required for minutes and seconds. Hours are constrained to 0-24; minutes and seconds are constrained to 0-59. Examples, formatted for English (United States):
|
IS_TIME_HOUR | Numeric representation of hours. Constrained to 0-24. |
IS_TIME_MINORSEC | Numeric representation of minutes or seconds. Constrained to 0-59. |
Phrase list
Setting an input scope as a phrase list enables you to specify a list of words or phrases to restrict or bias the input entered into the control. For example, you could create a phrase list named "Primary Colors" for a text box and then set the list to "red", "yellow", and "blue". In this scenario, if a Tablet PC user writes the word "Fred" in the text box, it will be recognized as and converted to the word "red".
To create a phrase list input scope:
-
Click Custom in the Input Scope dialog box, and then click New.
-
In the Name box, type the name of the phrase list input scope setting.
-
In the Type list, click Phrase List.
-
For each word or phrase in the list, type the word or phrase in the Phrase box, and then click Add.
After a phrase list has been created in a form template, you can apply it to other controls on the form by selecting it from the Input scope list.
Note: If you delete a phrase list input scope that has been applied to a control, the input scope will also be deleted from all other controls to which it has been applied, and its definition will be removed from the form template.
Regular expression
Setting an input scope as a regular expression enables you to specify a regular expression that defines a custom pattern for restricting or biasing the input entered into the control. You can learn more about the regular expression syntax used by Microsoft Office InfoPath 2007 input scopes in the Microsoft Tablet PC Software Development Kit (SDK).
To create a regular expression input scope setting:
-
Click Custom in the Input Scope dialog box, and then click New.
-
In the Name box, type the name of the regular expression input scope setting.
-
In the Type list, click Regular Expression.
-
In the Regular Expression box, type the regular expression formula.
After a regular expression has been created in a form template, you can apply it to other controls on the form by selecting it from the Input scope list.
Note: If you delete a regular expression input scope that has been applied to a control, the input scope will be deleted from all other controls to which it has been applied, and its definition will be removed from the form template.
The following table shows some examples of regular expressions that can be used to create a custom input scope settings.
Expression | Description | Matches | Non-matches |
(0|1|2|3|4|5|6|7|8|9) | Matches any single digit, 1 through 9. | 1 | 42 |
(0|1|2|3|4|5|6|7|8|9|,|-)+ | Matches one or more single digits, commas, or dashes. Useful for limiting input to a range or set of numbers, such as a range of pages to print. | 1 ,,, | Three |
(0|1|2|3|4|5|6|7|8|9)(0|1|2|3|4|5|6|7|8|9)(0|1|2|3|4|5|6|7|8|9)-(0|1|2|3|4|5|6|7|8|9)(0|1|2|3|4|5|6|7|8|9)-(0|1|2|3|4|5|6|7|8|9)(0|1|2|3|4|5|6|7|8|9)(0|1|2|3|4|5|6|7|8|9)(0|1|2|3|4|5|6|7|8|9)(0|1|2|3|4|5|6|7|8|9) | A social security number. The format of a social security number is nnn-nn-nnnn. | 123-45-6789 | 12-123-12 |
(0|1|2|3|4|5|6|7|8|9)(0|1|2|3|4|5|6|7|8|9)(0|1|2|3|4|5|6|7|8|9)-(A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|T|U|V|W|X|Y|Z)(A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|T|U|V|W|X|Y|Z)(A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|T|U|V|W|X|Y|Z)-(0|1|2|3|4|5|6|7|8|9)(0|1|2|3|4|5|6|7|8|9)(0|1|2|3|4|5|6|7|8|9) | A part number of this format: | 123-ABC-456 | 12-AB-3456 |
s(!IS_ONECHAR)+p | Matches any word that begins with lower case "s", contains one or more characters (as defined by the IS_ONECHAR input scope), and ends with a lower case "p". | stop | Stop |
No comments:
Post a Comment