MaskEdit.Change

Syntax

Change: function(sender,args)

Parameters

sender. Event source.

args. Event information.

Description

The Change event occurs on changing value in mask editor.

Example

To execute the example, connect links to the PP.js library and to the PP.css visual styles table on the HTML page. Create a mask editor used to date input. Add a handler for the Change event:

<script type="text/javascript">

    var MEdate = new PP.Ui.MaskEdit({

            ParentNode: document.getElementById("ME1"),

            Width: "170px",

            Height: "21px",

            Mask: "__.__.____",

            RegExpContent: "^(0[1-9]|1[0-9]|2[0-9]|3[0-1])\\.(0[1-9]|1[0-2])\\.(19\\d+|20\\d+)$"

        });

        MEdate.setValue("10.10.2010");

        MEdate.Change.add(function (sender, args) {

            alert("New date:" + MEdate.getLastValidValue());

        });

</script>

After executing the example the HTML page will contain a mask editor used to enter desired date with a specified value. On changing the value in the editor, a message with the new value is displayed.

NOTE. If the entered value does not correspond to a regular expression the indicator of invalid value flashes on. The previous value is set in the editor when the component loses focus. In this case a message that contains the new message is displayed.

See also:

MaskEdit