Please turn on JavaScript. To find out how to do this visit the WebWise JavaScript guide.

This is created automatically by the running validation and passed to the onValidate handler once all eligible tests have finished running.

Constructor

new glow.forms.ValidateResult(eventName)

Parameters

eventName
Type
String

Properties

altKey

Whether the alt key was pressed during the key event.

From
glow.events.Event
Type
Boolean

Description

Only available for keyboard events.

attachedTo

The object/element that the listener is attached to.

From
glow.events.Event
Type
Object | Element

Description

See the description for 'source' for more details.

button

A number representing which button was pressed.

From
glow.events.Event
Type
Number

Description

Only available for mouse events.

0 for the left button, 1 for the middle button or 2 for the right button.

capsLock

Whether caps-lock was on during the key event

From
glow.events.Event
Type
Boolean | Undefined

Description

Only available for keyboard events.

If the key is not alphabetic, this property will be undefined as it is not possible to tell if caps-lock is on in this scenario.

charCode

The unicode character code for a printable character.

From
glow.events.Event
Type
Number | Undefined

Description

Only available for keyboard events.

This will be undefined if the key was not a printable character.

chr

A printable character string.

From
glow.events.Event
Type
String

Description

Only available for keyboard events.

The string of the key that was pressed, for example 'j' or 's'.

This will be undefined if the key was not a printable character.

ctrlKey

Whether the ctrl key was pressed during the key event.

From
glow.events.Event
Type
Boolean

Description

Only available for keyboard events.

errorCount

The number of fields that had a failing test.

Type
Number
eventName

The name on the event that was associated with this validation.

Type
String
fields

Each field object has a name, a value {-1, 0, 1}, and a message.

key

A short identifier for the key for special keys.

From
glow.events.Event
Type
String | Undefined

Description

Only available for keyboard events.

If the key was not a special key this property will be undefined.

See the list of key identifiers in glow.events.addKeyListener

keyCode

An integer number represention of the keyboard key that was pressed.

From
glow.events.Event
Type
Number

Description

Only available for keyboard events.

pageX

The horizontal position of the mouse pointer in the page in pixels.

From
glow.events.Event
Type
Number

Description

Only available for mouse events.

pageY

The vertical position of the mouse pointer in the page in pixels.

From
glow.events.Event
Type
Number

Description

Only available for mouse events.

relatedTarget

The element that the mouse has come from or is going to.

From
glow.events.Event
Type
Element

Description

Only available for mouse over/out events.

shiftKey

Whether the shift key was pressed during the key event.

From
glow.events.Event
Type
Boolean

Description

Only available for keyboard events.

source

The actual object/element that the event originated from.

From
glow.events.Event
Type
Element

Description

For example, you could attach a listener to an 'ol' element to listen for clicks. If the user clicked on an 'li' the source property would be the 'li' element, and 'attachedTo' would be the 'ol'.

wheelDelta

The number of clicks up (positive) or down (negative) that the user moved the wheel.

From
glow.events.Event
Type
Number

Description

Only available for mouse wheel events.

Methods

defaultPrevented

Test if the default action has been prevented.

From
glow.events.Event

Synopsis

myValidateResult.defaultPrevented();

Returns

Boolean

True if the default action has been prevented.

preventDefault

Prevent the default action for events.

From
glow.events.Event

Synopsis

myValidateResult.preventDefault();

Description

This can also be achieved by returning false from an event callback

propagationStopped

Tests if propagation has been stopped for this event.

From
glow.events.Event

Synopsis

myValidateResult.propagationStopped();

Returns

Boolean

True if event propagation has been prevented.

Example

// see if anything handles the event on this, and if not fire it on this.overlay
var e = glow.events.fire(this, "open");
if (! e.propagationStopped()) { glow.events.fire(this.overlay, "open", e); }
stopPropagation

Stops the event propagating.

From
glow.events.Event

Synopsis

myValidateResult.stopPropagation();

Description

For DOM events, this stops the event bubbling up through event listeners added to parent elements. The event object is marked as having had propagation stopped (see propagationStopped).

Example

// catch all click events that are not links
glow.events.addListener( document, 'click', function () { alert('document clicked'); }
); glow.events.addListener( 'a', 'click', function (e) { e.stopPropagation(); }
);
Documentation generated by JsDoc Toolkit 2.1.0 on Mon Jul 06 2009 11:46:53 GMT+0100 (BST)

BBC © 2014The BBC is not responsible for the content of external sites. Read more.

This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.