MicroStrategy ONE

Formatting a Text Field control

The Text Field control displays as a text field consisting of a single row in Web or on a mobile device.

For steps to navigate to where you can select the following options, see Creating a transaction-enabled document.

To format a Text Field control

  1. You can require that users specify a value using the input object control before submitting their changes. Do one of the following:

    • To require users to specify a value for the control before submitting their changes, select the User must enter a value check box.

    • To allow users to submit their changes without specifying a value, clear the User must enter a value check box.

  2. For text fields based on an input object that contains text, specify the following:

    • To specify the minimum number of characters that can be typed into the text field, type the number of characters in the Minimum Length field.

    • To specify the maximum number of characters that can be typed into the text field, type the number of characters in the Maximum Length field.

  3. For text fields based on an input object that contains numeric data, specify the following:

    • To specify the smallest number a user can type in the text field, select the Minimum Value check box, then type the number in the field.

    • To specify the largest number a user can type in the text field, select the Maximum Value check box, then type the number in the field.

  4. You can choose to have Web automatically verify that the value entered in the text field is in the correct format when a user tries to submit the data. To do so, from the Validation drop-down list, select the type of format you want users to use when entering data in the text field. The options available may vary depending on the data type of the input object you are using to create the text field. Select one of the following:

    The available options can vary depending on the data type of the input object you are using to create the text field.

    • To allow users to enter text in any format, select No Validation.

    • To have users enter a phone number in the field, select Phone Number.

    • To have users enter a zip code in the field, select US Zip Code.

    • To have users enter a social security number in the field, select Social Security Number.

    • To have users enter text in a custom format, select Regular Expression. In the Expression field, type the regular expression you want to use to determine whether the text is in the correct format, using the JavaScript version of the regular expression syntax. For examples, see the table below.

  5. You can prevent the password from being displayed on the screen by displaying placeholder characters in place of the password when the user inputs the password into the text field. Do one of the following:

    • To use placeholder characters to display the password, select the Mask text (password) check box.

    • To display the password as the user inputs characters, clear the Mask text (password) check box.

The table below contains examples of regular expression syntax you can use to ensure users enter data in the correct format.

Type of Format

Regular Expression

Examples of Format

US or Canadian postal code

^((\d{5}-\d{4})|(\d{5})|([AaBbCcEeGgHhJjKkLlMmNnPpRrSsTtVvXxYy]\d[A-Za-z]\s?\d[A-Za-z]\d))$

22182

22182-6230

K8N 5W6

UK postal code

^[A-Za-z]{1,2}[\d]{1,2}([A-Za-z])?\s?[\d][A-Za-z]{2}$

CG1 2AB

cf564aa

Indian postal code

^[1-9]{3}\s{0,1}[0-9]{3}$

234675

456001

International phone number consisting of a plus sign, country code, and national number

^\+(?:[0-9] ?){6,14}[0-9]$

+31 20 794 8425

+32 2792 0436

Swedish phone number (SIS standard)

^(([+]\d{2}[ ][1-9]\d{0,2}[ ])|([0]\d{1,3}[-]))((\d{2}([ ]\d{2}){2})|(\d{3}([ ]\d{3})*([ ]\d{2})+))$

+46 8 555 123 45

08-777 123 78

0123-456 78

Italian phone number consisting of prefix, a dash (-), forward slash (/), or space, and number

^([0-9]*\-?\ ?\/?[0-9]*)$

02-123456

02/123456

02 555426

Email address

^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$

johndoe@address.com

janedoe@mail.org

URLs, include http, https, ftp, and mailto addresses

((mailto\:|(news|(ht|f)tp(s?))\://){1}\S+)

http://www.mstr.com

mailto:jsmith@address.com

ftp://ftp.testserver.com

ISBN 10 and ISBN 13 numbers

^(97(8|9))?\d{9}(\d|X)$

0224536779

9780552317248

Time specified in a twelve-hour format, followed by AM or PM

^ *(1[0-2]|[1-9]):[0-5][0-9] *(a|p|A|P)(m|M) *$

11:00am

9:00 PM

11:59 pm

Sixteen-digit credit card number

\d{4}-?\d{4}-?\d{4}-?\d{4}

1234-1234-1234-1234

1234567890123456