//--------------------------------------------------------------------------- // // Common Javascripts for All/Most Pages // //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- // -- Generic Form Validation -------------------------------------------------- // ----------------------------------------------------------------------------- // Generic Form Validation // // Copyright (C) 2000 Jacob Hage - [jacobhage@hotmail.com] // Distributed under the terms of the GNU Library General Public License // Documentation at http://www.hagedesign.dk/scripts/js/validation/ // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- // Initializing script - setting global variables // ----------------------------------------------------------------------------- var checkObjects = new Array(); // Array containing the objects to validate. var errors = ""; // Variable holding the error message. var returnVal = false; // General return value. The validated form will only be submitted if true. var language = new Array(); // Language independent error messages! var selectecLanguage = "english"; // Choose between "english", "danish", "dutch", "french", "spanish", "russian", "portuguese" language.english = new Array(); // Error messages in english: language.english.header = "The following error(s) occured:\n" language.english.start = " --> "; language.english.field = "The \""; language.english.require = "\" field is required"; language.english.min = " and must consist of at least "; language.english.max = " and must not contain more than "; language.english.minmax = " and no more than "; language.english.chars = " characters"; language.english.num = " and must contain only numbers"; language.english.special = "\" must contain no special characters"; language.english.email = "\" must contain a valid e-mail address"; language.english.footer = "Please correct the error(s) to yield better results.\n" // ----------------------------------------------------------------------------- // define - Call this function to initalize validation fields. // // f = form name containing the input field ("