GetFormActionsEventSource

Returns the source element for an event that is currently being handled and that was defined in a form action.

Parameters

None

Return Value

Result Value
Source element The element that was the source of the current event.

Example

This example turns the Title field red when it gains focus, and removes the color when it loses focus. (One of the events defined in the form action is "When Title field gains focus, then execute "Colorize();".)

function Colorize()
{
    var src = GetFormActionsEventSource();
    if (!src) return;

    src.style.backgroundColor = "#FF0000";
}

function Uncolorize()
{
    var src = GetFormActionsEventSource();
    if (!src) return;

    src.style.backgroundColor = "#FFFFFF";
}

Comments

The source element that is returned is only valid during the current event, so this method should be used within the context of a callback method.