fires before changing the value of a control
beforeChange: (value: string | object) => boolean | void;
Parameters:value: string | object
- the value to be set for the controlReturn false
to prevent changing the value of the control; otherwise, true
.
Example
form.getItem("timepicker").events.on("beforeChange", function(value) {
console.log("beforeChange", value);
return true;
});
The type of the value parameter depends on the applied valueFormat
and timeFormat
:
valueFormat: "string"
and timeFormat:24
are specified, the string value will include just the hour and minutes: "00:39"valueFormat: "string"
and timeFormat:12
are specified, the string value will include hour, minutes, and am/pm identifiers: "06:00AM"valueFormat: "timeObject"
and timeFormat:24
are specified, the object value will contain key:value
pairs for hours, minutes and their values: {hour: 0, minute: 39}
valueFormat: "timeObject"
and timeFormat:12
are specified, the object value will contain key:value
pairs for hours, minutes, am/pm identifiers and their values: {hour: 6, minute: 0, AM: true}
Change log: The event was added in v8.0
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4