codehaven - php snippets - coding help
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.

    No particular format required.

    Text field accepts numbers only.

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

    Formats vary.

    Formats vary.

    Formats vary.

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

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

    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).

    Text field accepts URLs formatted as,, or

    Was this code snippet helpful?