Spry User Guide - Support - Adobe
Spry User Guide - Support - Adobe
Spry User Guide - Support - Adobe
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
var textfieldwidget1 = new <strong>Spry</strong>.Widget.ValidationTextField("textfieldwidget1", "date",<br />
{format:"yyyy-mm-dd"});<br />
<br />
Thefollowingtableshowsafulllistofformattingoptions,aswellassomeothercommonoptionsandvalues,forthe<br />
third parameter.<br />
Option Value<br />
format "mm/dd/yy" (default); "mm/dd/yyyy"; "dd/mm/yyyy";<br />
"dd/mm/yy"; "yy/mm/dd"; "yyyy/mm/dd"; "mm-dd-yy";<br />
"dd-mm-yy"; "yyyy-mm-dd"; "mm.dd.yyyy";<br />
"dd.mm.yyyy";<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 Date value in the specified format<br />
pattern Not applicable<br />
Validate a time<br />
❖ To set the text field to accept a time format, add "time" as the value for the second parameter in the constructor,<br />
as follows:<br />
<br />
var sprytextfield1= new <strong>Spry</strong>.Widget.ValidationTextField("sprytextfield1", "time");<br />
<br />
The default date format is "HH:mm" (hours and minutes). You can, however, set a number of other time formats in<br />
the third parameter by using the format option, as in the following example:<br />
<br />
var textfieldwidget1 = new <strong>Spry</strong>.Widget.ValidationTextField("textfieldwidget1", "time",<br />
{format:"HH:mm:ss"});<br />
<br />
Thefollowingtableshowsafulllistofformattingoptions,aswellassomeothercommonoptionsandvalues,forthe<br />
third parameter.<br />
Option Value<br />
format "HH:mm" (the default); "HH:mm:ss"; "hh:mm tt";<br />
"hh:mm:ss tt"; "hh:mm t"; "hh:mm;ss t"; (where "tt" stands<br />
for am/pm format, and "t" stands for a/p format.)<br />
validateOn ["blur"]; ["change"]; or both together (["blur", "change"])<br />
isRequired true (the default); false<br />
useCharacterMasking false (the default); true<br />
SPRY<br />
<strong>User</strong> <strong>Guide</strong><br />
53