Focus

Highlights active field in a form and allows to add a class to every fields, except radio and checkbox

Parameters

form_idThe id of the formular.  By default it is ‘mainform’.
setBorderIf you want to add a class to each fields, except radio and checkbox.
elementClassThe class to apply to each fields.  By default it is ‘input_f’.
txtcolorText color when it is highlighted.
bgcolorBackground-color when it is highlighted.
durationDuration of the fade effect.

Exemple

You can initialize a focus by adding this in your html head this code :

<script type="text/javascript">
window.addEvent('domready', function() {
var myFocus = new Focus({
form_id : 'mainform',
setBorder : true,
txtcolor : '#000000',
bgcolor : '#ffffff',
elementClass : 'input_f',
duration : 742
});
});
</script>

Require

Core

* Core.js

Class

* Class.js

About

focus.js v.1.0 for mootools v1.1 05 / 2007

by Floor SA (http://www.floor.ch) MIT-style license

created by David Mignot and Luca Pillonel, last modified by David Mignot 05 june 07

Summary
Highlights active field in a form and allows to add a class to every fields, except radio and checkbox
Constructor
Private method
Private method
Private method

Functions

initialize

initialize: function(options)

Constructor

Lauch the class

validate

Private method

Add listener on submit action and launch check process.

changeBack

changeBackground: function(el)

Private method

Style the an hover style

revertBack

revertBack: function(el)

Private method

Style the element with the original style

initialize: function(options)
Constructor
changeBackground: function(el)
Private method
revertBack: function(el)
Private method