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.

Option Value<br />

format Not applicable<br />

validateOn ["blur"]; ["change"]; or both together (["blur", "change"])<br />

isRequired true (the default); false<br />

useCharacterMasking false (the default); true<br />

minChars/maxChars Not applicable<br />

minValue/maxValue Integer value<br />

pattern Not applicable<br />

Validate an email<br />

❖ To set the text field to accept only standard e-mail formats, add "email" asthevalueforthesecondparameterin<br />

the constructor, as follows:<br />

<br />

var sprytextfield1= new <strong>Spry</strong>.Widget.ValidationTextField("sprytextfield1", "email");<br />

<br />

You can also set options for the third parameter by using the following syntax:<br />

<br />

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

{option:value});<br />

<br />

The following table shows some common options and values for the third parameter.<br />

Option Value<br />

format Not applicable<br />

validateOn ["blur"]; ["change"]; or both together (["blur",<br />

"change"])<br />

isRequired true (the default); false<br />

useCharacterMasking Not applicable<br />

minChars/maxChars Positive integer value<br />

minValue/maxValue Not applicable<br />

pattern Not applicable<br />

Validate a date<br />

❖ To set the text field to accept a date format, add "date" as the value for the second parameter in the constructor,<br />

as follows:<br />

<br />

var sprytextfield1= new <strong>Spry</strong>.Widget.ValidationTextField("sprytextfield1", "date");<br />

<br />

The default date format is "mm/dd/yy" (U.S. date format). You can, however, set a number of other date formats in<br />

the third parameter by using the format option, as in the following example:<br />

SPRY<br />

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

52

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

Saved successfully!

Ooh no, something went wrong!