/* spryvalidationselect.js - revision: spry preview release 1.4 */ // copyright (c) 2006. adobe systems incorporated. // all rights reserved. // // redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // * redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // * redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // * neither the name of adobe systems incorporated nor the names of its // contributors may be used to endorse or promote products derived from this // software without specific prior written permission. // // this software is provided by the copyright holders and contributors "as is" // and any express or implied warranties, including, but not limited to, the // implied warranties of merchantability and fitness for a particular purpose // are disclaimed. in no event shall the copyright owner or contributors be // liable for any direct, indirect, incidental, special, exemplary, or // consequential damages (including, but not limited to, procurement of // substitute goods or services; loss of use, data, or profits; or business // interruption) however caused and on any theory of liability, whether in // contract, strict liability, or tort (including negligence or otherwise) // arising in any way out of the use of this software, even if advised of the // possibility of such damage. var spry; if (!spry) spry = {}; if (!spry.widget) spry.widget = {}; spry.widget.validationselect = function(element, opts) { this.init(element); spry.widget.utils.setoptions(this, opts); // set validateon flags var validateon = ['submit'].concat(this.validateon || []); validateon = validateon.join(","); this.validateon = 0 | (validateon.indexof('submit') != -1 ? spry.widget.validationselect.onsubmit : 0); this.validateon = this.validateon | (validateon.indexof('blur') != -1 ? spry.widget.validationselect.onblur : 0); this.validateon = this.validateon | (validateon.indexof('change') != -1 ? spry.widget.validationselect.onchange : 0); // unfortunately in some browsers like safari, the stylesheets our // page depends on may not have been loaded at the time we are called. // this means we have to defer attaching our behaviors until after the // onload event fires, since some of our behaviors rely on dimensions // specified in the css. if (spry.widget.validationselect.onloaddidfire) this.attachbehaviors(); else spry.widget.validationselect.loadqueue.push(this); }; spry.widget.validationselect.onchange = 1; spry.widget.validationselect.onblur = 2; spry.widget.validationselect.onsubmit = 4; spry.widget.validationselect.prototype.init = function(element) { this.element = this.getelement(element); this.selectelement = null; this.form = null; this.event_handlers = []; // this.element can be either the container () // or the