Friday, November 6, 2020

Input scopes for infopath controls

In this article

Introduction to input scopes

Types of input scopes

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.

Top of Page

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:

  • http://www.humongousinsurance.com/

  • ftp://ftp.microsoft.com

  • www.microsoft.com

  • file:///C:\templ.txt

IS_FILE_FULLFILEPATH

Characters used in describing a file path. Includes the following conditions:

  • For server name and share name, allows all IS_ONECHAR characters except: * ? : < > |

  • For file name, allows all IS_ONECHAR characters except: \ / : < > |

  • Input must start with \\ or drive name or \ or ..\ or .\ or /

  • Spaces are allowed.

Examples:

  • \\servername\sharename\filename.txt

  • C:\temp\current work.doc

  • ..\images\hank.jpg

IS_FILE_FILENAME

Characters used in describing a file name. Includes the following conditions:

  • Accepts either extension or no extension.

  • Allows all IS_ONECHAR characters except: \ / : < > |

  • Spaces are allowed.

Examples:

  • filename.txt

  • filename

  • file name.txt

IS_EMAIL_USERNAME

E-mail user names.

Examples:

  • JeffSm

  • JSmith

  • jeffsmith

IS_EMAIL_SMTPEMAILADDRESS

Complete SMTP email address. For example, someone@example.com.

IS_LOGINNAME

Login name and domain. Includes the following conditions:

  • Allows all IS_ONECHAR characters.

  • Does not allow domain or username to start or end in a non-alphanumeric character.

  • Spaces are not allowed.

  • The following characters are not allowed: + * / (plus sign, asterisk, forward slash).

Examples:

  • CHICAGO\JSMITH

  • JSMITH

IS_PERSONALNAME_FULLNAME

Combinations of first, middle, and last names.

Examples, formatted for English (United States):

  • Mr. Jeff A. Smith, Jr.

  • Jeff Smith

  • Smith, Jeff

  • Smith, Jeff A

IS_PERSONALNAME_PREFIX

Honorific or title preceding a name.

Examples, formatted for English (United States):

  • Mr.

  • Dr.

  • Miss

  • Sir

IS_PERSONALNAME_GIVENNAME

First name or initial.

Examples, formatted for English (United States):

  • Jeff

  • J.

  • J.A.

IS_PERSONALNAME_MIDDLENAME

Middle name or initial.

Examples:

  • Albert

  • A

IS_PERSONALNAME_SURNAME

Last name.

Examples, formatted for English (United States):

  • Smith

  • Smith Jones

  • Smith-Jones

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):

  • 123 Main Street, Seattle, WA 98121

  • PO Box 123, Redmond, WA 98052

IS_ADDRESS_POSTALCODE

Alphanumeric (for international support) postal code.

Examples, formatted for English (United States):

  • 98033

  • 98052-6399

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):

  • WA

  • Washington

  • Wa

IS_ADDRESS_CITY

Name or abbreviation of city.

Examples, formatted for English (United States):

  • New York

  • NYC

IS_ADDRESS_COUNTRYNAME

Name of Country.

Examples, formatted for English (United States):

  • Italy

  • Japan

  • United States of America

IS_ADDRESS_COUNTRYSHORTNAME

Abbreviation for country.

Examples, formatted for English (United States):

  • USA

  • U.S.A.

IS_CURRENCY_AMOUNTANDSYMBOL

Currency symbols and numbers.

Examples, formatted for English (United States):

  • $ 2,100.25

  • $.35

  • $1,234.50 USD

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):

  • 07-17-2001

  • 7/17/01

  • 7/17

  • Dec. 12

  • July 17

  • July 17, 2001

IS_DATE_MONTH

Numeric representation of months, constrained to 1-12.

Examples:

  • 7

  • 07

  • 11

IS_DATE_DAY

Numeric representation of days, constrained to 1-31.

Examples:

  • 1

  • 04

  • 17

IS_DATE_YEAR

Numeric representation of years.

Examples:

  • 1988

  • 2004

  • 88

  • 04

  • '88

IS_DATE_MONTHNAME

Character representation of months.

Examples, formatted for English (United States):

  • February

  • Dec

  • Dec.

IS_DATE_DAYNAME

Character representation of days.

Examples, formatted for English (United States):

  • Wednesday

  • Wed

  • Mon.

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:

  • The thousand separator is a comma.

  • The decimal separator is a period.

  • Negative numbers are represented with a hyphen without a space, not with parentheses.

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):

  • (425) 555-0112

  • 555-0123

  • 555.0123

  • 206-555-0123

  • 1-206-555-0123x1234

  • +1 (206) 555-1234

IS_TELEPHONE_COUNTRYCODE

Telephone country codes.

Examples, formatted for English (United States):

  • +1

  • +44

  • 001

  • 00 44

IS_TELEPHONE_AREACODE

Telephone area codes.

Examples, formatted for English (United States):

  • (425)

  • 425

IS_TELEPHONE_LOCALNUMBER

Telephone number, excluding country or area code.

Examples, formatted for English (United States):

  • 555-0112

  • 555 0112

  • 555.0123

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):

  • 3:20

  • 04:30

  • 11:20:55

  • 11:15 am

  • 4:30 AM

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:

  1. Click Custom in the Input Scope dialog box, and then click New.

  2. In the Name box, type the name of the phrase list input scope setting.

  3. In the Type list, click Phrase List.

  4. 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:

  1. Click Custom in the Input Scope dialog box, and then click New.

  2. In the Name box, type the name of the regular expression input scope setting.

  3. In the Type list, click Regular Expression.

  4. 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
6
0

42
One

(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
1-6
2,4,7
2-
6,9,135

,,,

Three
7 thru 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)(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
12-2-3456

(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:
###-AAA-###
where # is any single digit from 0 to 9, and A is any single capital letter from A to Z.

123-ABC-456

12-AB-3456
123-456-789

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
soup
schlep
s234p

Stop
sp

Top of Page

No comments:

Post a Comment