<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">

<html>
	<head>
		<title>FormCheck</title>
		<link rel="stylesheet" type="text/css" href="styles/reset.css" />
		<link rel="stylesheet" type="text/css" href="styles/main.css">
		<script language=JavaScript src="styles/javascript/main.js"></script>
		<script language=JavaScript src="styles/javascript/searchdata.js"></script>
	</head>
	<body class="ContentPage" onLoad="NDOnLoad()"><div id="header"><div class="inner"><a href="../" title="Mootools Floor" class="moofloor"></a><ul class="mainmenu"><li id="category23"><a href="http://mootools.floor.ch/en/download/index.htm">Download</a></li><li id="category25"><a href="http://mootools.floor.ch/blog/index.php">Blog</a></li><li id="category23"><a href="http://mootools.floor.ch/en/docs/index.htm" class="s">Docs</a></li><li id="category26"><a href="http://mootools.floor.ch/en/talk/index.htm">Talk</a></li><li id="category27"><a href="http://mootools.floor.ch/en/labs/index.htm">Labs</a></li><li id="category28"><a href="http://mootools.floor.ch/en/code/index.htm">Code</a></li></ul></div></div><div class="MainWrapper"><script language=JavaScript><!--
if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script><div id="MainWrapper">

<!--  Generated by Natural Docs, version 1.4 -->
<!--  http://www.naturaldocs.org  -->

<!-- saved from url=(0026)http://www.naturaldocs.org -->


<div id=Content><div class="CClass"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="FormCheck"></a>FormCheck</h1><div class=CBody><p>Performs different tests on forms and indicates errors.</p><h4 class=CHeading>Usage</h4><p>Works with these types of fields :</p><ul><li>input (text, radio, checkbox)</li><li>textarea</li><li>select</li></ul><p>You just need to add a specific class to each fields you want to check.&nbsp; For example, if you add the class</p><blockquote><pre>validate['required','length[4, -1]','differs[email]','digit']</pre></blockquote><p>the value&rsquo;s field must be set (required) with a minimum length of four chars (4, -1), must differs of the input named email (differs[email]), and must be digit.</p><p>You can perform check during the datas entry or on the submit action, shows errors as tips or in a div before or after the field, show errors one by one or all together, show a list of all errors at the top of the form, localize error messages, add new regex check, ...</p><p>The layout is design only with css.&nbsp; Now I added a hack to use transparent png with IE6, so you can use png images in formcheck.css (works only for theme, so the file must be named formcheck.css).&nbsp; It can also works with multiple forms on a single html page.&nbsp; The class supports now internationalization.&nbsp; To use it, simply specify a new &lt;script&gt; element in your html head, like this : &lt;script type=&rdquo;text/javascript&rdquo; src=&rdquo;formcheck/lang/fr.js&rdquo;&gt;&lt;/script&gt;.</p><p>If you add the class</p><blockquote><pre>validate['submit']</pre></blockquote><p>to an element like an anchor (or anything else), this element will act as a submit button.</p><p>N.B.&nbsp; : you must load the language script before the formcheck and this method overpass the old way.&nbsp; You can create new languages following existing ones.&nbsp; You can otherwise still specifiy the alerts&rsquo; strings when you initialize the Class, with options.&nbsp; If you don&rsquo;t use a language script, the alert will be displayed in english.</p><h4 class=CHeading>Test type</h4><p>You can perform various test on fields by addind them to the validate class.&nbsp; Be careful to <b>not use space chars</b>.&nbsp; Here is the list of them.</p><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>required</td><td class=CDLDescription>The field becomes required.&nbsp; This is a regex, you can change it with class options.</td></tr><tr><td class=CDLEntry>alpha</td><td class=CDLDescription>The value is restricted to alphabetic chars.&nbsp; This is a regex, you can change it with class options.</td></tr><tr><td class=CDLEntry>alphanum</td><td class=CDLDescription>The value is restricted to alphanumeric characters only.&nbsp; This is a regex, you can change it with class options.</td></tr><tr><td class=CDLEntry>nodigit</td><td class=CDLDescription>The field doesn&rsquo;t accept digit chars.&nbsp; This is a regex, you can change it with class options.</td></tr><tr><td class=CDLEntry>digit</td><td class=CDLDescription>The value is restricted to digit (no floating point number) chars, you can pass two arguments (f.e. digit[21,65]) to limit the number between them.&nbsp; Use -1 as second argument to not set a maximum.</td></tr><tr><td class=CDLEntry>number</td><td class=CDLDescription>The value is restricted to number, including floating point number.&nbsp; This is a regex, you can change it with class options.</td></tr><tr><td class=CDLEntry>email</td><td class=CDLDescription>The value is restricted to valid email.&nbsp; This is a regex, you can change it with class options.</td></tr><tr><td class=CDLEntry>phone</td><td class=CDLDescription>The value is restricted to phone chars.&nbsp; This is a regex, you can change it with class options.</td></tr><tr><td class=CDLEntry>url:</td><td class=CDLDescription>The value is restricted to url.&nbsp; This is a regex, you can change it with class options.</td></tr><tr><td class=CDLEntry>confirm</td><td class=CDLDescription>The value has to be the same as the one passed in argument. f.e. confirm[password].</td></tr><tr><td class=CDLEntry>differs</td><td class=CDLDescription>The value has to be diferent as the one passed in argument. f.e. differs[user].</td></tr><tr><td class=CDLEntry>length</td><td class=CDLDescription>The value length is restricted by argument (f.e. length[6,10]).&nbsp; Use -1 as second argument to not set a maximum.</td></tr></table><p>You can also use a custom function to check a field.&nbsp; For example, if you have a field with class</p><blockquote><pre>validate['required','%customCheck']</pre></blockquote><p>the function customCheck(el) will be called to validate the field.&nbsp; Here is an example of what customCheck could look :</p><blockquote><pre>function customCheck(el){
    if (!el.value.test(/^[A-Z]/)) {
        el.errors.push(&quot;Username should begin with an uppercase letter&quot;);
        return false;
    } else {
        return true;
    }
}</pre></blockquote><h4 class=CHeading>Parameters</h4><p>When you initialize the class with addEvent, you can set some options.&nbsp; If you want to modify regex, you must do it in a hash, like for display or alert.&nbsp; You can also add new regex check method by adding the regex and an alert with the same name.</p><h4 class=CHeading>Required</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>form_id</td><td class=CDLDescription>The id of the formular.&nbsp; This is required.</td></tr></table><h4 class=CHeading>Optional</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>submitByAjax</td><td class=CDLDescription>you can set this to true if you want to submit your form with ajax.&nbsp; You should use provided events to handle the ajax request (see below).&nbsp; By default it is false.</td></tr><tr><td class=CDLEntry>ajaxResponseDiv</td><td class=CDLDescription>id of element to inject ajax response into (can also use onAjaxSuccess).&nbsp; By default it is false.</td></tr><tr><td class=CDLEntry>ajaxEvalScripts</td><td class=CDLDescription>use evalScripts in the Request response.&nbsp; Can be true or false, by default it is false.</td></tr><tr><td class=CDLEntry>onAjaxRequest</td><td class=CDLDescription>Function to fire when the Request event starts.</td></tr><tr><td class=CDLEntry>onAjaxSuccess</td><td class=CDLDescription>Function to fire when the Request receives .  Args: response [the request response] - see Mootools docs for Request.onSuccess.</td></tr><tr><td class=CDLEntry>onAjaxFailure</td><td class=CDLDescription>Function to fire if the Request fails.</td></tr><tr><td class=CDLEntry>tipsClass</td><td class=CDLDescription>The class to apply to tipboxes&rsquo; errors.&nbsp; By default it is &lsquo;fc-tbx&rsquo;.</td></tr><tr><td class=CDLEntry>errorClass</td><td class=CDLDescription>The class to apply to alertbox (not tips).&nbsp; By default it is &lsquo;fc-error&rsquo;.</td></tr><tr><td class=CDLEntry>fieldErrorClass</td><td class=CDLDescription>The class to apply to fields with errors, except for radios.&nbsp; You should also turn on  options.addClassErrorToField.&nbsp; By default it is &lsquo;fc-field-error&rsquo;</td></tr><tr><td class=CDLEntry>trimValue</td><td class=CDLDescription>If set to true, strip whitespace (or other characters) from the beginning and end of values.&nbsp; By default it is false.</td></tr><tr><td class=CDLEntry>validateDisabled</td><td class=CDLDescription>If set to true, disabled input will be validated too, otherwise not.</td></tr></table><h4 class=CHeading>Display</h4><p>This is a hash of display settings. in here you can modify.</p><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>showErrors</td><td class=CDLDescription>0 : onSubmit, 1 : onSubmit &amp; onBlur, by default it is 1.</td></tr><tr><td class=CDLEntry>titlesInsteadNames</td><td class=CDLDescription>0 : When you do a check using differs or confirm, it takes the field name for the alert.&nbsp; If it&rsquo;s set to 1, it will use the title instead of the name.</td></tr><tr><td class=CDLEntry>errorsLocation</td><td class=CDLDescription>1 : tips, 2 : before, 3 : after, by default it is 1.</td></tr><tr><td class=CDLEntry>indicateErrors</td><td class=CDLDescription>0 : none, 1 : one by one, 2 : all, by default it is 1.</td></tr><tr><td class=CDLEntry>keepFocusOnError</td><td class=CDLDescription>0 : normal behaviour, 1 : the current field keep the focus as it remain errors.&nbsp; By default it is 0.</td></tr><tr><td class=CDLEntry>checkValueIfEmpty</td><td class=CDLDescription>0 : When you leave a field and you have set the showErrors option to 1, the value is tested only if a value has been set.&nbsp; 1 : The value is tested  in any case.&nbsp;  By default it is 1.</td></tr><tr><td class=CDLEntry>addClassErrorToField</td><td class=CDLDescription>0 : no class is added to the field, 1 : the options.fieldErrorClass is added to the field with an error (except for radio).&nbsp; By default it is 0.</td></tr><tr><td class=CDLEntry>fixPngForIe</td><td class=CDLDescription>0 : do nothing, 1 : fix png alpha for IE6 in formcheck.css.&nbsp; By default it is 1.</td></tr><tr><td class=CDLEntry>replaceTipsEffect</td><td class=CDLDescription>0 : No effect on tips replace when we resize the broswer, 1: tween transition on browser resize;</td></tr><tr><td class=CDLEntry>closeTipsButton</td><td class=CDLDescription>0 : the close button of the tipbox is hidden, 1 : the close button of the tipbox is visible.&nbsp; By default it is 1.</td></tr><tr><td class=CDLEntry>flashTips</td><td class=CDLDescription>0 : normal behaviour, 1 : the tipbox &ldquo;flash&rdquo; (disappear and reappear) if errors remain when the form is submitted.&nbsp; By default it is 0.</td></tr><tr><td class=CDLEntry>tipsPosition</td><td class=CDLDescription>&rsquo;right&rsquo; : the tips box is placed on the right part of the field, &lsquo;left&rsquo; to place it on the left part.&nbsp; By default it is &lsquo;right&rsquo;.</td></tr><tr><td class=CDLEntry>tipsOffsetX</td><td class=CDLDescription>Horizontal position of the tips box (margin-left), , by default it is 100 (px).</td></tr><tr><td class=CDLEntry>tipsOffsetY</td><td class=CDLDescription>Vertical position of the tips box (margin-bottom), , by default it is -10 (px).</td></tr><tr><td class=CDLEntry>listErrorsAtTop</td><td class=CDLDescription>List all errors at the top of the form, , by default it is false.</td></tr><tr><td class=CDLEntry>scrollToFirst</td><td class=CDLDescription>Smooth scroll the page to first error and focus on it, by default it is true.</td></tr><tr><td class=CDLEntry>fadeDuration</td><td class=CDLDescription>Transition duration (in ms), by default it is 300.</td></tr></table><h4 class=CHeading>Alerts</h4><p>This is a hash of alerts settings. in here you can modify strings to localize or wathever else.&nbsp; %0 and %1 represent the argument.</p><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>required</td><td class=CDLDescription>&rdquo;This field is required.&rdquo;</td></tr><tr><td class=CDLEntry>alpha</td><td class=CDLDescription>&rdquo;This field accepts alphabetic characters only.&rdquo;</td></tr><tr><td class=CDLEntry>alphanum</td><td class=CDLDescription>&rdquo;This field accepts alphanumeric characters only.&rdquo;</td></tr><tr><td class=CDLEntry>nodigit</td><td class=CDLDescription>&rdquo;No digits are accepted.&rdquo;</td></tr><tr><td class=CDLEntry>digit</td><td class=CDLDescription>&rdquo;Please enter a valid integer.&rdquo;</td></tr><tr><td class=CDLEntry>digitmin</td><td class=CDLDescription>&rdquo;The number must be at least %0&rdquo;</td></tr><tr><td class=CDLEntry>digitltd</td><td class=CDLDescription>&rdquo;The value must be between %0 and %1&rdquo;</td></tr><tr><td class=CDLEntry>number</td><td class=CDLDescription>&rdquo;Please enter a valid number.&rdquo;</td></tr><tr><td class=CDLEntry>email</td><td class=CDLDescription>&rdquo;Please enter a valid email: &lt;br /&gt;&lt;span&gt;E.g.&nbsp; email target=&rdquo;yourname@domain.com&rdquo; name=&rdquo;yourname@domain.com&rdquo;&lt;/span&gt;&rdquo;</td></tr><tr><td class=CDLEntry>phone</td><td class=CDLDescription>&rdquo;Please enter a valid phone.&rdquo;</td></tr><tr><td class=CDLEntry>url</td><td class=CDLDescription>&rdquo;Please enter a valid url: &lt;br /&gt;&lt;span&gt;E.g.&nbsp; url target=&rdquo;http://www.domain.com&rdquo; name=&rdquo;http://www.domain.com&rdquo;&lt;/span&gt;&rdquo;</td></tr><tr><td class=CDLEntry>confirm</td><td class=CDLDescription>&rdquo;This field is different from %0&rdquo;</td></tr><tr><td class=CDLEntry>differs</td><td class=CDLDescription>&rdquo;This value must be different of %0&rdquo;</td></tr><tr><td class=CDLEntry>length_str</td><td class=CDLDescription>&rdquo;The length is incorrect, it must be between %0 and %1&rdquo;</td></tr><tr><td class=CDLEntry>length_fix</td><td class=CDLDescription>&rdquo;The length is incorrect, it must be exactly %0 characters&rdquo;</td></tr><tr><td class=CDLEntry>lengthmax</td><td class=CDLDescription>&rdquo;The length is incorrect, it must be at max %0&rdquo;</td></tr><tr><td class=CDLEntry>lengthmin</td><td class=CDLDescription>&rdquo;The length is incorrect, it must be at least %0&rdquo;</td></tr><tr><td class=CDLEntry>checkbox</td><td class=CDLDescription>&rdquo;Please check the box&rdquo;</td></tr><tr><td class=CDLEntry>radios</td><td class=CDLDescription>&rdquo;Please select a radio&rdquo;</td></tr><tr><td class=CDLEntry>select</td><td class=CDLDescription>&rdquo;Please choose a value&rdquo;</td></tr></table><h4 class=CHeading>Example</h4><p>You can initialize a formcheck (no scroll, custom classes and alert) by adding for example this in your html head this code :</p><blockquote><pre>&lt;script type=&quot;text/javascript&quot;&gt;
    window.addEvent('domready', function() {
        var myCheck = new FormCheck('form_id', {
            tipsClass : 'tips_box',
            display : {
                scrollToFirst : false
            },
            alerts : {
                required : 'This field is ablolutely required! Please enter a value'
            }
        })
    });
&lt;/script&gt;</pre></blockquote><h4 class=CHeading>About</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>formcheck.js v.1.4 for mootools v1.2</td><td class=CDLDescription>11 / 2008</td></tr></table><p>by Floor SA (<a href="http://www.floor.ch" class=LURL target=_top>http://www.floor.ch</a>) MIT-style license</p><p>Created by Luca Pillonel, last modified by Luca Pillonel</p><h4 class=CHeading>Credits</h4><p>This class was inspired by fValidator by Fabio Zendhi Nagao (<a href="http://zend.lojcomm.com.br" class=LURL target=_top>http://zend.lojcomm.com.br</a>)</p><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SMain"><td class=SEntry><a href="#FormCheck" >FormCheck</a></td><td class=SDescription>Performs different tests on forms and indicates errors.</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#FormCheck.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#FormCheck.initialize" id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">initialize</a></td><td class=SDescription>Constructor</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#FormCheck.register" id=link2 onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')">register</a></td><td class=SDescription>Private method</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#FormCheck.validate" id=link3 onMouseOver="ShowTip(event, 'tt3', 'link3')" onMouseOut="HideTip('tt3')">validate</a></td><td class=SDescription>Private method</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#FormCheck.simpleValidate" id=link4 onMouseOver="ShowTip(event, 'tt4', 'link4')" onMouseOut="HideTip('tt4')">simpleValidate</a></td><td class=SDescription>Private method</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#FormCheck.validateRegex" id=link5 onMouseOver="ShowTip(event, 'tt5', 'link5')" onMouseOut="HideTip('tt5')">validateRegex</a></td><td class=SDescription>Private method</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#FormCheck.validateConfirm" id=link6 onMouseOver="ShowTip(event, 'tt6', 'link6')" onMouseOut="HideTip('tt6')">validateConfirm</a></td><td class=SDescription>Private method</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#FormCheck.validateDiffers" id=link7 onMouseOver="ShowTip(event, 'tt7', 'link7')" onMouseOut="HideTip('tt7')">validateDiffers</a></td><td class=SDescription>Private method</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#FormCheck.isChildType" id=link8 onMouseOver="ShowTip(event, 'tt8', 'link8')" onMouseOut="HideTip('tt8')">isChildType</a></td><td class=SDescription>Private method</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#FormCheck.validateGroup" id=link9 onMouseOver="ShowTip(event, 'tt9', 'link9')" onMouseOut="HideTip('tt9')">validateGroup</a></td><td class=SDescription>Private method</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#FormCheck.listErrorsAtTop" id=link10 onMouseOver="ShowTip(event, 'tt10', 'link10')" onMouseOut="HideTip('tt10')">listErrorsAtTop</a></td><td class=SDescription>Private method</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#FormCheck.manageError" id=link11 onMouseOver="ShowTip(event, 'tt11', 'link11')" onMouseOut="HideTip('tt11')">manageError</a></td><td class=SDescription>Private method</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#FormCheck.addError" id=link12 onMouseOver="ShowTip(event, 'tt12', 'link12')" onMouseOut="HideTip('tt12')">addError</a></td><td class=SDescription>Private method</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#FormCheck.addPositionEvent" id=link13 onMouseOver="ShowTip(event, 'tt13', 'link13')" onMouseOut="HideTip('tt13')">addPositionEvent</a></td><td class=SDescription>Update tips position after a browser resize</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#FormCheck.removeError" id=link14 onMouseOver="ShowTip(event, 'tt14', 'link14')" onMouseOut="HideTip('tt14')">removeError</a></td><td class=SDescription>Private method</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#FormCheck.focusOnError" id=link15 onMouseOver="ShowTip(event, 'tt15', 'link15')" onMouseOut="HideTip('tt15')">focusOnError</a></td><td class=SDescription>Private method</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#FormCheck.fixIeStuffs" id=link16 onMouseOver="ShowTip(event, 'tt16', 'link16')" onMouseOut="HideTip('tt16')">fixIeStuffs</a></td><td class=SDescription>Private method</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#FormCheck.makeTips" id=link17 onMouseOver="ShowTip(event, 'tt17', 'link17')" onMouseOut="HideTip('tt17')">makeTips</a></td><td class=SDescription>Private method</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#FormCheck.reinitialize" id=link18 onMouseOver="ShowTip(event, 'tt18', 'link18')" onMouseOut="HideTip('tt18')">reinitialize</a></td><td class=SDescription>Private method</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#FormCheck.submitByAjax" id=link19 onMouseOver="ShowTip(event, 'tt19', 'link19')" onMouseOut="HideTip('tt19')">submitByAjax</a></td><td class=SDescription>Private method</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#FormCheck.onSubmit" id=link20 onMouseOver="ShowTip(event, 'tt20', 'link20')" onMouseOut="HideTip('tt20')">onSubmit</a></td><td class=SDescription>Private method</td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>

<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="FormCheck.Functions"></a>Functions</h3></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="FormCheck.initialize"></a>initialize</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>initialize : function(</td><td class=PParameter nowrap>form,</td></tr><tr><td></td><td class=PParameter nowrap>options</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Constructor</p><p>Add event on formular and perform some stuff, you now, like settings, ...</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="FormCheck.register"></a>register</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>register : function(</td><td class=PParameter nowrap>el</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Private method</p><p>Add listener on fields</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="FormCheck.validate"></a>validate</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>validate : function(</td><td class=PParameter nowrap>el</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Private method</p><p>Dispatch check to other methods</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="FormCheck.simpleValidate"></a>simpleValidate</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>simpleValidate : function(</td><td class=PParameter nowrap>el</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Private method</p><p>Perform simple check for select fields and checkboxes</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="FormCheck.validateRegex"></a>validateRegex</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>validateRegex : function(</td><td class=PParameter nowrap>el,</td></tr><tr><td></td><td class=PParameter nowrap>ruleMethod,</td></tr><tr><td></td><td class=PParameter nowrap>ruleArgs</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Private method</p><p>Perform regex validations</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="FormCheck.validateConfirm"></a>validateConfirm</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>validateConfirm: function(</td><td class=PParameter nowrap>el,</td></tr><tr><td></td><td class=PParameter nowrap>ruleArgs</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Private method</p><p>Perform confirm validations</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="FormCheck.validateDiffers"></a>validateDiffers</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>validateDiffers: function(</td><td class=PParameter nowrap>el,</td></tr><tr><td></td><td class=PParameter nowrap>ruleArgs</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Private method</p><p>Perform differs validations</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="FormCheck.isChildType"></a>isChildType</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>isChildType: function(</td><td class=PParameter nowrap>el</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Private method</p><p>Determine if the field is a group of radio or not.</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="FormCheck.validateGroup"></a>validateGroup</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>validateGroup : function(</td><td class=PParameter nowrap>el</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Private method</p><p>Perform radios validations</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="FormCheck.listErrorsAtTop"></a>listErrorsAtTop</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>listErrorsAtTop : function(</td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Private method</p><p>Display errors</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="FormCheck.manageError"></a>manageError</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>manageError : function(</td><td class=PParameter nowrap>el,</td></tr><tr><td></td><td class=PParameter nowrap>method</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Private method</p><p>Manage display of errors boxes</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="FormCheck.addError"></a>addError</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>addError : function(</td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Private method</p><p>Add error message</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="FormCheck.addPositionEvent"></a>addPositionEvent</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>addPositionEvent : function(</td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Update tips position after a browser resize</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="FormCheck.removeError"></a>removeError</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>removeError : function(</td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Private method</p><p>Remove the error display</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="FormCheck.focusOnError"></a>focusOnError</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>focusOnError : function (</td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Private method</p><p>Create set the focus to the first field with an error if needed</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="FormCheck.fixIeStuffs"></a>fixIeStuffs</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>fixIeStuffs : function ()</td></tr></table></blockquote><p>Private method</p><p>Fix png for IE6</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="FormCheck.makeTips"></a>makeTips</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>makeTips : function(</td><td class=PParameter nowrap>txt</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Private method</p><p>Create tips boxes</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="FormCheck.reinitialize"></a>reinitialize</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>reinitialize: function()</td></tr></table></blockquote><p>Private method</p><p>Reinitialize form before submit check</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="FormCheck.submitByAjax"></a>submitByAjax</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>submitByAjax: function()</td></tr></table></blockquote><p>Private method</p><p>Send the form by ajax, and replace the form with response</p></div></div></div>

<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="FormCheck.onSubmit"></a>onSubmit</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>onSubmit: function(</td><td class=PParameter nowrap>event</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Private method</p><p>Perform check on submit action</p></div></div></div>

</div><!--Content-->


<div id=Footer><a href="http://www.naturaldocs.org">Generated by Natural Docs</a></div><!--Footer-->



<!--START_ND_TOOLTIPS-->
<div class=CToolTip id="tt1"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>initialize : function(</td><td class=PParameter nowrap>form,</td></tr><tr><td></td><td class=PParameter nowrap>options</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Constructor</div></div><div class=CToolTip id="tt2"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>register : function(</td><td class=PParameter nowrap>el</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Private method</div></div><div class=CToolTip id="tt3"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>validate : function(</td><td class=PParameter nowrap>el</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Private method</div></div><div class=CToolTip id="tt4"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>simpleValidate : function(</td><td class=PParameter nowrap>el</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Private method</div></div><div class=CToolTip id="tt5"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>validateRegex : function(</td><td class=PParameter nowrap>el,</td></tr><tr><td></td><td class=PParameter nowrap>ruleMethod,</td></tr><tr><td></td><td class=PParameter nowrap>ruleArgs</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Private method</div></div><div class=CToolTip id="tt6"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>validateConfirm: function(</td><td class=PParameter nowrap>el,</td></tr><tr><td></td><td class=PParameter nowrap>ruleArgs</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Private method</div></div><div class=CToolTip id="tt7"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>validateDiffers: function(</td><td class=PParameter nowrap>el,</td></tr><tr><td></td><td class=PParameter nowrap>ruleArgs</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Private method</div></div><div class=CToolTip id="tt8"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>isChildType: function(</td><td class=PParameter nowrap>el</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Private method</div></div><div class=CToolTip id="tt9"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>validateGroup : function(</td><td class=PParameter nowrap>el</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Private method</div></div><div class=CToolTip id="tt10"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>listErrorsAtTop : function(</td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Private method</div></div><div class=CToolTip id="tt11"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>manageError : function(</td><td class=PParameter nowrap>el,</td></tr><tr><td></td><td class=PParameter nowrap>method</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Private method</div></div><div class=CToolTip id="tt12"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>addError : function(</td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Private method</div></div><div class=CToolTip id="tt13"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>addPositionEvent : function(</td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Update tips position after a browser resize</div></div><div class=CToolTip id="tt14"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>removeError : function(</td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Private method</div></div><div class=CToolTip id="tt15"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>focusOnError : function (</td><td class=PParameter nowrap>obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Private method</div></div><div class=CToolTip id="tt16"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>fixIeStuffs : function ()</td></tr></table></blockquote>Private method</div></div><div class=CToolTip id="tt17"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>makeTips : function(</td><td class=PParameter nowrap>txt</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Private method</div></div><div class=CToolTip id="tt18"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>reinitialize: function()</td></tr></table></blockquote>Private method</div></div><div class=CToolTip id="tt19"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td>submitByAjax: function()</td></tr></table></blockquote>Private method</div></div><div class=CToolTip id="tt20"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class=Prototype><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>onSubmit: function(</td><td class=PParameter nowrap>event</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Private method</div></div><!--END_ND_TOOLTIPS-->




<div id=MSearchResultsWindow><iframe src="" frameborder=0 name=MSearchResults id=MSearchResults></iframe><a href="javascript:searchPanel.CloseResultsWindow()" id=MSearchResultsWindowClose>Close</a></div>


</div><script language=JavaScript><!--
if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></div></body></html>
