fValidate.basic

fValidate.basic - } } fValidate.prototype.length =...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
/*************************************************** / fValidate Copyright (c) 2000-2003 by Peter Bailey www.peterbailey.net/fValidate/ w fValidate.basic.js f Included Validators ------------------- blank length l This file is only part of a larger validation library and will not function autonomously. a Created at a tab-spacing of four (4) C ****************************************************/ * fValidate.prototype.blank = function() { if ( this.typeMismatch( 'text' ) ) return; if ( this.isBlank() ) { this.throwError( [this.elem.fName] );
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: } } fValidate.prototype.length = function( len, maxLen ) { if ( this.typeMismatch( 'text' ) ) return; var vlen = this.elem.value.length; len = Math.abs( len ); maxLen = Math.abs( this.setArg( maxLen, Number.infinity ) ); if ( len > maxLen ) { this.devError( [len, maxLen, this.elem.name] ); return; } if ( len > parseInt( vlen, 10 ) ) { this.throwError( [this.elem.fName, len] ); } if ( vlen > maxLen ) { this.throwError( [this.elem.fName, maxLen, vlen], 1 ); } } // EOF...
View Full Document

This note was uploaded on 08/14/2009 for the course ITP 204X taught by Professor Dent during the Spring '08 term at USC.

Ask a homework question - tutors are online