A class that describes an input mask of the "pattern"
maskType
.
The following code shows how to specify the properties of this class within a survey JSON schema:
const surveyJson = {
"elements": [{
"name": "textquestion1"
"type": "text",
"maskType": "pattern",
"maskSettings": {
// Specify the properties of a pattern input mask here
}
}]
}
Inherited from the following class(es):
Creates a new object that has the same type and properties as the current SurveyJS object.
Assigns a new JSON schema to the current survey element.
The JSON schema should contain only serializable properties of this survey element. Event handlers and properties that do not belong to the survey element are ignored.
A JSON schema that you want to apply to the current survey element.
options, type: ILoadFromJSONOptions ,An object with configuration options.
options.validatePropertyValues, type: boolean ,Pass true
if you want to validate property values. Use the jsonErrors
array to access validation errors.
Returns a JsonObjectProperty
object with metadata about a serializable property that belongs to the current SurveyJS object.
If the property is not found, this method returns null
.
A property name.
Returns the value of a property with a specified name.
If the property is not found or does not have a value, this method returns either undefined
, defaultValue
specified in the property configuration, or a value passed as the defaultValue
parameter.
A property name.
defaultValue, type: any ,(Optional) A value to return if the property is not found or does not have a value.
calcFunc, type: () => any
Returns the object type as it is used in the JSON schema.
Use this method to find out if the current object is of a given typeName
or inherited from it.
One of the values listed in the getType() description.
true
if the current object is of a given typeName
or inherited from it.
Returns true
if the survey is being designed in Survey Creator.
Returns true
if the object configuration is being loaded from JSON.
Returns true
if a passed value
is an empty string, array, or object or if it equals to undefined
or null
.
A value to be checked.
trimString, type: boolean ,(Optional) When this parameter is true
, the method ignores whitespace characters at the beginning and end of a string value. Pass false
to disable this functionality.
An event that is raised when an ItemValue
property is changed.
Parameters:
sender
: this
ItemValue
objects.options.obj
: ItemValue
ItemValue
object.options.propertyName
: string
ItemValue
objects is assigned (for example, "choices"
or "rows"
).options.name
: "text"
| "value"
options.newValue
: any
An event that is raised when a property of this SurveyJS object has changed.
Parameters:
sender
: this
options.name
: string
options.newValue
: any
options.oldValue
: any
oldValue
contains the same array as newValue
does.If you need to add and remove property change event handlers dynamically, use the registerPropertyChangedHandlers
and unregisterPropertyChangedHandlers
methods instead.
A pattern for the input value.
If you set the maskType
to "pattern"
, the mask can contain string literals and the following placeholders:
9
- A digit.a
- An upper- or lower-case letter.#
- A digit or an upper- or lower-case letter.Use backslash \
to escape a character.
Example: +1(999)-999-99-99
If you set the maskType
to "datetime"
, the mask can contain separator characters and the following placeholders:
m
- Month number.mm
- Month number, with leading zero for single-digit values.d
- Day of the month.dd
- Day of the month, with leading zero for single-digit values.yy
- Last two digits of the year.yyyy
- A four-digit year.H
- Hours in 24-hour format.HH
- Hours in 24-hour format, with leading zero for single-digit values.h
- Hours in 12-hour format.hh
- Hours in 12-hour format, with leading zero for single-digit values.MM
- Minutes.ss
- Seconds.TT
- 12-hour clock period in upper case (AM/PM).tt
- 12-hour clock period in lower case (am/pm).Example: mm/dd/yyyy HH:MM:ss
This property is stored in the survey JSON definition and can be edited in the Survey Creator.
Registers a single value change handler for one or multiple properties.
The registerPropertyChangedHandlers
and unregisterPropertyChangedHandlers
methods allow you to manage property change event handlers dynamically. If you only need to attach an event handler without removing it afterwards, you can use the onPropertyChanged
event instead.
An array of one or multiple property names.
handler, type: any ,A function to call when one of the listed properties change. Accepts a new property value as an argument.
key, type: string ,(Optional) A key that identifies the current registration. If a function for one of the properties is already registered with the same key, the function will be overwritten. You can also use the key to subsequently unregister handlers.
Specifies whether to store the question value with an applied mask in survey results.
Default value: false
This property is stored in the survey JSON definition and can be edited in the Survey Creator.
Assigns a new value to a specified property.
A property name.
val, type: any ,A new value for the property.
Returns a JSON schema that corresponds to the current survey element.
An object with configuration options.
options.storeDefaults, type: boolean ,Pass true
if the JSON schema should include properties with default values.
A JSON schema of the survey element.
Unregisters value change event handlers for the specified properties.
An array of one or multiple property names.
key, type: string ,(Optional) A key of the registration that you want to cancel.
Copyright © 2025 Devsoft Baltic OÜ. All rights reserved.
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