Search
Generic filters
Exact matches only
  • Spry validation formats

    19th November 2013

    Random Coding

    random coding category codehaven

    First of all I don’t use, never will and also dislike Dreamweaver.

    It goes where the bold section is
    var sprytextfield1 = new Spry.Widget.ValidationTextField(“sprytextfield1”, “none”, {validateOn:[“change”]});
    P.S. Don’t use speech marks if changing from “none”.

    var sprytextfield3 = new Spry.Widget.ValidationTextField(“sprytextfield2”, “email”, {maxChars:40});
    var sprytextfield4 = new Spry.Widget.ValidationTextField(“sprytextfield3”, “none”, {minChars:6, maxChars:15});
    var sprytextfield6 = new Spry.Widget.ValidationTextField(“sprytextfield5”, “date”, {format:”dd/mm/yyyy”});

    AND : – it can be {validateOn:[“blur”]});

    But here are some formats that I found if you need to.


    None
    No particular format required.

    integer
    Text field accepts numbers only.

    email
    Text field accepts e-mail addresses that contain the @ sign and a period (.) that is both preceded and followed by at least one letter.

    date
    Formats vary.

    time
    Formats vary.

    zip_code
    Formats vary.

    phone_number
    Text field accepts phone numbers formatted for U.S. and Canada (000) 000-0000 as well as custom formats.

    currency
    Text field accepts currency formatted as 1,000,000.00 or 1.000.000,00.

    real
    Validates various kinds of numbers and scientific notation: integers (for example, 1); float values (for example, 12.123); and float values in scientific notation (for example, 1.212e+12, 1.221e-12 where e is used as a power of 10).

    url
    Text field accepts URLs formatted as http://xxx.xxx.xxx, https://xxx.xxx.xxx, or ftp://xxx.xxx.xxx.

    Was this code snippet helpful?

    Comment on this Code Snippet?