http://www.phil-taylor.com/fvalidate/ This is G o o g l e's cache of http://www.peterbailey.net/fValidate/types/numeric/ as retrieved on Oct 8, 2005 00:38:21 GMT. G o o g l e's cache is the snapshot that we took of the page as we crawled the web. The page may have changed since that time. Click here for the current page without highlighting. This cached page may reference images which are no longer available. Click here for the cached text only. To link to or bookmark this page, use the following url: http://www.google.com/search?q=cache:Ob3SS88u5vQJ:www.peterbailey.net/fValidate/types/numeric/+fvalidate+types&hl=en&client=firefox-a Google is neither affiliated with the authors of this page nor responsible for its content. These search terms have been highlighted: fvalidate These terms only appear in links pointing to this page: types fValidate v5.00b - A javascript form validation tool by Peter Bailey Proudly hosted by 1&1. * Home * About * Features * Download * API * Validator Type Reference * Compatibility * Demo Form * Known Issues * Changelog * Future Plans * Testimonials * Contact Me Powered by patXMLRenderer Rate this script @ HotScripts.com Also Featured on Dynamic Drive! Validator-Type Reference Home / Type Reference / numeric Legend - color coding parameter - the name of the parameter. Requirement - whether or not this parameter is required. Data type - the data-type of this parameter. Default value - If parameter is optional and not included, this is the default value used. Other value - Other possible value. Value description - not a literal value, but a description of what one can be. Value example - an example of a valid value. blank What it does Check if field is blank Errors If Field is left blank or only whitespace characters are present in it's value Parameters No parameters. Notes Whitespace characters include Space, Tab, Carriage Return, Newline, Formfeed bok No. Demo Form Name - blank Applicable Elements * text * password * textarea In File fValidate.basic.js length What it does Validates to a minimum length. Errors If Field value is shorter than minimum length specified or field is left blank. Parameters min Integer Optional - Sets minimum allowed length maxLen Integer Optional - Sets maximum allowed length Notes Any paramter entered as a negative will be converted to a positive before use. bok Yes. Demo Form Password - length|6 Applicable Elements * text * password * textarea In File fValidate.basic.js equalto What it does Validate equality with a 2nd field. Errors If Field value is shorter than minimum length specified or field is left blank. Parameters otherObjName String Required - Name or id of other form element to be equal to bok Yes. Demo Form Email - blank Email Confirm - equalto|Email Applicable Elements * text * password * textarea In File fValidate.logical.js number What it does Validate integers and floats. Errors If Field value is shorter than minimum length specified or field is left blank. Parameters type Boolean Optional - 0 For integers 1 For floats lb Integer Optional - Lower bound (minimum accepted value) ub Integer Optional - Upper bound (maximum accepted value) bok Yes. Demo Form Age - number|0|1|120 Applicable Elements * text * password * textarea In File fValidate.numbers.js numeric What it does Validate numbers as strings. Errors If Field contains any non-digit characters or field is left blank Parameters min Integer - Sets minimum length bok Yes. Demo Form Promotion Code - numeric|4 Applicable Elements * text * password * textarea In File fValidate.numbers.js alnum What it does Validates alphanumeric text to specified rules Errors If Field contains any characters other than a-z or A-Z or 0-9 (if set) or does not meet minimum length or has trailing or leading spaces or has invalid punctuation or field is left blank Parameters min Integer Optional - Sets minimum length case String Optional - Sets case rules a or A Any case accepted u or U UPPERCASE l or L lowercase c or C Initial capital numbers Boolean Optional - Sets whether or not numbers are allowed. false Numbers aren't allowed true Numbers are allowed spaces Boolean Optional - Sets whether or not spaces are allowed. false Spaces aren't allowed true Spaces are allowed puncs String Optional - Sets what punctuation characters are allowed. any Any punctuation is allowed none No punctuation allowed Any String of allowed punctuation Specified string of punctuation allowed bok Yes. Applicable Elements * text * password * textarea In File fValidate.extended.js decimal What it does Validates a simple decimal format Errors If Field data does not match decimal format specified or is left blank Notes Wildcards (*) can be used for either parameter, specifying any number of digits for that side Parameters leftDigits Integer Optional - Sets exact number of digits that must appear to the left of the decimal rightDigits Integer Optional - Sets exact number of digits that must appear to the right of the decimal bok Yes. Demo Form Batting Average - decimal|0|3 Applicable Elements * text * password * textarea In File fValidate.numbers.js decimalr What it does Validate a complex decimal format. Errors If Field data does not match decimal format specified or is left blank. Parameters leftDigitsMin Integer Optional - Sets minimum number of digits that must appear to the left of the decimal leftDigitsMax Integer Optional - Sets maximum number of digits that must appear to the left of the decimal rightDigitsMin Integer Optional - Sets minimum number of digits that must appear to the right of the decimal righttDigitsMax Integer Optional - Sets maximum number of digits that must appear to the right of the decimal Notes Wildcards (*) can be used for any parameter, specifying any number of digits for that value. bok Yes. Demo Form Radio Station (FM) - decimalr|2|3|1|1 Applicable Elements * text * password * textarea In File fValidate.numbers.js ip What it does Validate an IP addres. Errors If Field does not match the standard IP addess format of xxx.xxx.xxx.xxx or port number is out of specified bounds or field is left blank. Parameters portMin Integer Optional - Sets lowest port number allowed portMax Integer Optional - Sets highest port number allowed bok Yes. Demo Form IP Address - ip|0|8000 Applicable Elements * text * password * textarea In File fValidate.web.js ssn What it does Validate a US Social Security Number. Errors If Field does not match the standard SSN format of XXX-XX-XXXX or field is left blank. Parameters No parameters. bok Yes. Demo Form Social Security Number - ssn Applicable Elements * text * password * textarea In File fValidate.extended.js money What it does Validate US currency (or similar) format. Errors If Field data does not match money format specified or is left blank. Parameters ds String Optional - Specifies "dollar sign" character required. grp String Optional - Specifies "grouping" character required. dml String Optional - Specifies "decimal" character required. Notes Any parameter that is left blank will exclude that format requirement from validation. bok Yes. Demo Form Money 1 - money|$|,|. Money 2 - money|£|.|, Applicable Elements * text * password * textarea In File fValidate.ecommerce.js cc What it does Validates credit card input. Errors If If card number entered doesn't match establish card rules or doesn't validate against the LUHN checksum or is left blank. Parameters No parameters. Notes Make sure you property setup a ccType element as defined in the config for the cc validation. Also note that the acceptable option values for this element are VISA, MC, DISC, AMEX, DINERS, ENROUTE, JCB, Switch, Delta, and Solo. bok Yes. Demo Form Credit Card Type Credit Card Number Applicable Elements * text * password * textarea In File fValidate.ecommerce.js zip What it does Validate US Zip Code (regular or +4). Errors If Field data does not match the valid US 5 digit or Zip+4 format or is left blank Parameters sep String Optional - Character(s) that separate the two sets of digits. bok Yes. Demo Form Zip Code - zip Applicable Elements * text * password * textarea In File fValidate.extended.js phone What it does Validate US-style phone number. Errors If Field data does not match a valid US phone number format (10 or 7 digit) or is left blank. Parameters format Integer Optional - Sets strictness of format adherence 0 Loose format - parens, dashes, and area-code are optional. 1 Strict format - parens, dashes, and area-code are required. bok Yes. Demo Form Phone 1 - phone Phone 2 - phone|1 Applicable Elements * text * password * textarea In File fValidate.extended.js email What it does Validate an email address. Errors If Field data does not match a valid email format or is left blank. Parameters level Integer Optional - Sets strictness level of format adherence 0 Least strict 1 Medium-low strict 2 Medium-high strict 3 Most strict bok Yes. Demo Form Email 1 - email Email 2 - email|3 Applicable Elements * text * password * textarea In File fValidate.web.js url What it does Validate a URL. Errors If Field data does not match a valid URL format or is left blank. Parameters hosts String Optional - A comma-separated list of allowed hosts http Allow domains only from this host. http,https,ftp If you wanted to include several hosts. hostOptional Boolean Optional - Indicates whether or not the host is required for the URL to validate. allowQS Boolean Optional - Indicates whether or not a query-string may exist on the URL to be validated. bok Yes. Demo Form URL 1 - url URL 2 - url|https,ftp|0|0 Applicable Elements * text * password * textarea In File fValidate.web.js date What it does Validate a date for format and time-relation. Errors If Field data is not a correctly formatted date, or is before or after specDate or is left blank Parameters formatStr String Required - Format expected for date. Use foward slash to separate parts. mm/dd/yyyy US et al date format. dd/mm/yyyy European date format. yyyy/mm/dd Universal date format. delim String Optional - The delimeter(s) you wish to allow for separating date pieces / Standard foward-slash. -/ Allows the hyphen OR the forward-slash code Integer Optional - A code used to validate time reference to specDate. 0 Time relation is not used in validation. 1 Date must be before date acquired by specDate. 2 Date must be on or before date acquired by specDate. 3 Date must be after date acquired by specDate. 4 Date must be on or after date acquired by specDate. specDate String Optional - The date used to compare against entered date for time-relation. today Uses current day for comparison. JSDate Any javascript date-object compatible string-representation of a date. elementName The name of another element in the same form who's value is a date for comparison. bok Yes. Demo Form Date 1 - date|mm/dd/yyyy|/|1|today Date 2 - date|dd/mm/yyyy|-|3|Date_1 Date 3 - date|yyyy/mm/dd| |4|Date_2 Applicable Elements * text * password * textarea In File fValidate.datetime.js select What it does Validate a select object for a selected index past 0. Errors If Initial index (0) of the select object is selected (indicating no change made). Parameters No parameters. bok No. Demo Form Country - select Applicable Elements * selectSingle (selectSingle) In File fValidate.controls.js selectm What it does Validate a multiple-select for the quantity selected. Errors If Number of selected options does not fall within specified min/max values. Parameters minS Integer Required - Minimum number of selections required. maxS Mixed Optional - Maximum number of selections allowed. * Wildcard - no maximum. 999 Alias for the wildcard Any Integer If a higher number than the quantity of options available, default is used. bok No. Demo Form Sandwich Preferences - selectm|1|3 Applicable Elements * selectMultiple (selectMultiple) In File fValidate.controls.js selecti What it does Validate a select against a list of restriced indexes. Errors If The selected index matches one of those in the restricted list. Parameters indexes String Required - A comma-separated list of indexes that are not valid selections. Notes Remember, the indexes of select element options are zero-based. bok No. Demo Form Credit Card Type - selecti|0,1,6,10 Applicable Elements * selectSingle (selectSingle) In File fValidate.controls.js checkbox What it does Verify that a certain number of boxes have been checked. Errors If Number of checked options does not fall within specified min/max values. Parameters minC Integer Required - Minimum number of selections required. maxC Mixed Optional - Maximum number of selections allowed. * Wildcard - no maximum. 999 Alias for the wildcard Any Integer If a higher number than the quantity of boxes available, default is used. Notes You only need to place validator attribute on the first checkbox in the array. bok No. Demo Form Mailing Lists News 'o' the day Jelly of the month update Movies this week Jokes Jokes Jokes Your IRA and you - checkbox|2|4 Applicable Elements * checkbox In File fValidate.controls.js radio What it does Verify that one button in the group has been ticked. Errors If None of the buttons in the radio-button group are checked. Parameters No parameters. Notes Only put the validator attribute on the first button in the group. bok Yes. Demo Form Do you like inline skating? Yes No - radio Applicable Elements * radio In File fValidate.controls.js comparison What it does Compare two fields using any logical comparison operator. Errors If If the expression between the two fields yields false Parameters field1 String Required - The name of the element that field2 will be compared against. operator String Required - The operator used to compare the field1's value with field2's value. > Greater than < Less than >= Greater than or equal to <= Less than or equal to == Equal to != Not equal to field2 String Required - The name of the element for field1 to be compared to. Notes The expression is evaluated in this manner field1 operator field2 If the outcome of the expression is false, the validation will fail. bok No. Demo Form Number One Number Two - comparison|Number_One|>|Number_Two Number Three - comparison|Number_Three|<=|Number_One Applicable Elements * hidden In File fValidate.logical.js eitheror What it does Ensure that one and only one field has data. Errors If All of the specified fields are blank or more than 1 of the specified fields contains data. Parameters delim String Required - Delimeter you intend to used in seperated list of field-names. fields String Required - delim-separated list of element names (must be in the same form) to include in this validation. Notes To my knowledge, there is no practical limit to the number of fields that you can include with eitheror. The hidden input that receives the validation attribute must have a name or id specified for this to function. Since the eitheror validator is attached to a separate hidden field, each of the included fields can still have it's own validator, but must be modified with bok. You must place the hidden input with the eitheror validator after all the inputs in its list. The hidden field must have a name attribute for the box error mode to function properly. At this time, eitheror's logical check is only compatible with text-based form elements. bok For hidden input, no, but is required for all elements eitheror references. Demo Form Last Name Maiden Name - eitheror|,|Last_Name,Maiden_Name Applicable Elements * hidden In File fValidate.logical.js atleast What it does Ensures that there is data in at least n fields. Errors If Fewer than the specified number of fields have data. Parameters qty Integer Required - Validate for at least this many fields. delim String Required - Delimeter you intend to used in seperated list of field-names. fields String Required - delim-separated list of element names (must be in the same form) to include in this validation. Notes To my knowledge, there is no practical limit to the number of fields that you can include with atleast. The hidden input that receives the validation attribute must have a name or id specified for this to function. Since the atleast validator is attached to a separate hidden field, each of the included fields can still have it's own validator, but must be modified with bok. You must place the hidden input with the atleast validator after all the inputs in its list. The hidden field must have a name attribute for the box error mode to function properly. At this time, atleast's logical check is only compatible with text-based form elements. bok For hidden input, no, but is required for all elements atleast references. Demo Form Home Phone Office Phone Cell Phone - atleast|2|,|Home_Phone,Office_Phone,Cell_Phone Applicable Elements * hidden In File fValidate.logical.js allornone What it does Ensures that either all of the fields int he list have data, or none of the fields in the list have data. Errors If Only some of the fields in the list have data. Parameters delim String Required - Delimeter you intend to used in seperated list of field-names. fields String Required - delim-separated list of element names (must be in the same form) to include in this validation. Notes To my knowledge, there is no practical limit to the number of fields that you can include with allornone. The hidden input that receives the validation attribute must have a name or id specified for this to function. Since the allornone validator is attached to a separate hidden field, each of the included fields can still have it's own validator, but must be modified with bok. You must place the hidden input with the allornone validator after all the inputs in its list. The hidden field must have a name attribute for the box error mode to function properly. At this time, allornone's logical check is only compatible with text-based form elements. bok For hidden input, no, but is required for all elements atleast references. Demo Form Business Name Business Phone Business Address Applicable Elements * hidden In File fValidate.logical.js file What it does Restricts file entered to specified filetypes Errors If File entered is not of valid type as specified or is left blank Parameters extensions String Required - A comma-separated list of allowed file extensions. zip,jpg,pdf Allows JPEG, ZIP archive, and PDF files. cSens Boolean Optional - Indicates whether or not extension-matching should be case-sensitive. This will rarely need to be changed from the default false. bok Yes. Demo Form File Upload - file|zip,jpg,pdf|0 Applicable Elements * file In File fValidate.controls.js custom What it does Allows for custom application of regular expression patterns. Errors If If pattern test fails. Parameters Notes Write patterns normally. Don't double-escapce meta-characters. bok Yes. Demo Form Applicable Elements * text In File fValidate.special.js cazip What it does Validates Canadian postcodes Errors If Field value is not a valid Canadian postcode or is left blank. Parameters No parameters. Notes This validator has an alias inside fValidate called capost. bok Yes. Demo Form Postcode - cazip Applicable Elements * text * password * textarea In File fValidate.international.js ukpost What it does Validates UK postcodes. Errors If Field value is not a valid UK postcode or is left blank. Parameters No parameters. bok Yes. Demo Form Postcode - ukpost Applicable Elements * text * password * textarea In File fValidate.international.js germanpost What it does Validates German postcodes. Errors If Field value is not a valid German postcode or is left blank. Parameters No parameters. bok Yes. Demo Form Postcode - germanpost Applicable Elements * text * password * textarea In File fValidate.international.js swisspost What it does Validates Swiss postcodes. Errors If Field value is not a valid Swiss postcode or is left blank. Parameters No parameters. bok Yes. Demo Form Postcode - swisspost Applicable Elements * text * password * textarea In File fValidate.international.js Copyright © 2000-2004 by PeterBailey.net Web Design | XHTML 1.0