04.02.2013 Views

Spry User Guide - Support - Adobe

Spry User Guide - Support - Adobe

Spry User Guide - Support - Adobe

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Value Description<br />

"0" Whole numbers between 0 and 9<br />

"A" Uppercase alphabetic characters<br />

"a" Lowercase alphabetic characters<br />

"B"; "b" Case-insensitive alphabetic characters<br />

"X" Uppercase alpha-numeric characters<br />

"x" Lowercase alpha-numeric characters<br />

"Y"; "y" Case-insensitive alpha-numeric characters<br />

"?" Any character<br />

Any characters (letters, punctuation, and so on) other than the backslash (\) and those listed in the preceding table<br />

are considered autocomplete characters, and <strong>Spry</strong> can insert these kinds of characters at the appropriate time. For<br />

example, if you have a zip code like UT.99CW, you might want to have <strong>Spry</strong> insert the period automatically after the<br />

user types the first two capital letters.<br />

❖ To use an autocomplete character, insert the character in the format pattern, as follows:<br />

<br />

var textfieldwidget1 = new <strong>Spry</strong>.Widget.ValidationTextField("textfieldwidget1",<br />

"zip_code", {format:"zip_custom", pattern:"AA.00AA"});<br />

<br />

The preceding code results in a text field that accepts values such as UT.99CW, AB.87PP, GV.44RE, and so on, with<br />

the period appearing as an autocomplete character after the user types the first two capital letters.<br />

You can also have <strong>Spry</strong> autocomplete letters (other than those in the preceding table), as in the following example:<br />

<br />

var textfieldwidget1 = new <strong>Spry</strong>.Widget.ValidationTextField("textfieldwidget1",<br />

"zip_code", {format:"zip_custom", pattern:"AA.00AAF3"});<br />

<br />

The preceding code results in a text field that accepts values such as UT.99CWF3, AB.87PPF3, GV.44REF3, and so<br />

on, with the period appearing as an autocomplete character after the user types the first two capital letters, and the<br />

F3 appearing after the user types the last two capital letters.<br />

To use any of the special characters listed in the preceding table as an autocomplete character, escape them with a<br />

double backslash (\\), as in the following example:<br />

<br />

var textfieldwidget1 = new <strong>Spry</strong>.Widget.ValidationTextField("textfieldwidget1",<br />

"zip_code", {format:"zip_custom", pattern:"AA.00AA\\B3"});<br />

<br />

The preceding code results in a text field that accepts values such as UT.99CWB3, AB.87PPB3, GV.44REB3, and so<br />

on, with the period appearing as an autocomplete character after the user types the first two capital letters, and the<br />

B3 appearing after the user types the last two capital letters.<br />

Touseabackslash(\)aspartofanautocompletesequence,doubleit,andescapeitusingadoublebackslash—atotal<br />

of four backslashes (\\\\)—as follows:<br />

SPRY<br />

<strong>User</strong> <strong>Guide</strong><br />

64

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!