\Kendo\UI\MaskedTextBox

A PHP wrapper for Kendo UI MaskedTextBox.

Inherits from \Kendo\UI\Widget.

Usage

To use MaskedTextBox in a PHP page instantiate a new instance, configure it via the available configuration methods and output it by echo-ing the result of the render method.

Using Kendo MaskedTextBox

<?php
// Create a new instance of MaskedTextBox and specify its id
$maskedTextBox = new \Kendo\UI\MaskedTextBox('MaskedTextBox');

// Configure it
$maskedTextBox->clearPromptChar(true)

// Output it

echo $maskedTextBox->render();
?>

Methods

change

Fires when the value is changed For additional information check the change event documentation.

Returns

\Kendo\UI\MaskedTextBox

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

<?php
$maskedTextBox = new \Kendo\UI\MaskedTextBox('MaskedTextBox');
$maskedTextBox->change('function(e) { }');
?>

Example - using string which defines a JavaScript name

<script>
    function onChange(e) {
        // handle the change event.
    }
</script>
<?php
$maskedTextBox = new \Kendo\UI\MaskedTextBox('MaskedTextBox');
$maskedTextBox->change('onChange');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$maskedTextBox = new \Kendo\UI\MaskedTextBox('MaskedTextBox');
$maskedTextBox->change(new \Kendo\JavaScriptFunction('function(e) { }'));
?>

clearPromptChar

Specifies whether the widget will replace the prompt characters with spaces on blur. Prompt chars will be shown again on focus (available since Q2 2014 SP1).

Returns

\Kendo\UI\MaskedTextBox

Parameters

$value boolean

Example

<?php
$maskedTextBox = new \Kendo\UI\MaskedTextBox('MaskedTextBox');
$maskedTextBox->clearPromptChar(true);
?>

culture

Specifies the culture info used by the widget.

Returns

\Kendo\UI\MaskedTextBox

Parameters

$value string

Example

<?php
$maskedTextBox = new \Kendo\UI\MaskedTextBox('MaskedTextBox');
$maskedTextBox->culture('value');
?>

fillMode

Sets a value controlling how the color is applied. Can also be set to the following string values: "none"; "solid"; "flat" or "outline".

Returns

\Kendo\UI\MaskedTextBox

Parameters

$value string

Example

<?php
$maskedTextBox = new \Kendo\UI\MaskedTextBox('MaskedTextBox');
$maskedTextBox->fillMode('value');
?>

label

Adds a label before the input. If the input has no id attribute, a generated id will be assigned. The string and the function parameters are setting the inner HTML of the label.

Returns

\Kendo\UI\MaskedTextBox

Parameters

$value string|\Kendo\JavaScriptFunction|\Kendo\UI\MaskedTextBoxLabel|array

Example - using string

<?php
$maskedTextBox = new \Kendo\UI\MaskedTextBox('MaskedTextBox');
$maskedTextBox->label('value');
?>

Example - using \Kendo\JavaScriptFunction

<?php
$maskedTextBox = new \Kendo\UI\MaskedTextBox('MaskedTextBox');
$maskedTextBox->label(new \Kendo\JavaScriptFunction('function() { }'));
?>

Example - using \Kendo\UI\MaskedTextBoxLabel

<?php
$maskedTextBox = new \Kendo\UI\MaskedTextBox('MaskedTextBox');
$label = new \Kendo\UI\MaskedTextBoxLabel();
$content = 'value';
$label->content($content);
$maskedTextBox->label($label);
?>

Example - using array

<?php
$maskedTextBox = new \Kendo\UI\MaskedTextBox('MaskedTextBox');
$content = 'value';
$maskedTextBox->label(array('content' => $content));
?>

mask

Specifies the input mask. The following mask rules are supported: 0 - Digit. Accepts any digit between 0 and 9.; 9 - Digit or space. Accepts any digit between 0 and 9, plus space.; # - Digit or space. Like 9 rule, but allows also (+) and (-) signs.; L - Letter. Restricts input to letters a-z and A-Z. This rule is equivalent to [a-zA-Z] in regular expressions.; ? - Letter or space. Restricts input to letters a-z and A-Z. This rule is equivalent to [a-zA-Z] in regular expressions.; & - Character. Accepts any character. The rule is equivalent to \S in regular expressions.; C - Character or space. Accepts any character. The rule is equivalent to . in regular expressions.; A - Alphanumeric. Accepts letters and digits only.; a - Alphanumeric or space. Accepts letters, digits and space only.; . - Decimal placeholder. The decimal separator will be gotten from the current culture used by Kendo.; , - Thousands placeholder. The display character will be gotten from the current culture used by Kendo. or $ - Currency symbol. The display character will be gotten from the current culture used by Kendo..

Returns

\Kendo\UI\MaskedTextBox

Parameters

$value string

Example

<?php
$maskedTextBox = new \Kendo\UI\MaskedTextBox('MaskedTextBox');
$maskedTextBox->mask('value');
?>

prefixOptions

The configuration for the prefix adornment of the component.

Returns

\Kendo\UI\MaskedTextBox

Parameters

$value \Kendo\UI\MaskedTextBoxPrefixOptions|array

Example - using \Kendo\UI\MaskedTextBoxPrefixOptions

<?php
$maskedTextBox = new \Kendo\UI\MaskedTextBox('MaskedTextBox');
$prefixOptions = new \Kendo\UI\MaskedTextBoxPrefixOptions();
$icon = 'value';
$prefixOptions->icon($icon);
$maskedTextBox->prefixOptions($prefixOptions);
?>

Example - using array

<?php
$maskedTextBox = new \Kendo\UI\MaskedTextBox('MaskedTextBox');
$icon = 'value';
$maskedTextBox->prefixOptions(array('icon' => $icon));
?>

promptChar

Specifies the character used to represent the absence of user input in the widget

Returns

\Kendo\UI\MaskedTextBox

Parameters

$value string

Example

<?php
$maskedTextBox = new \Kendo\UI\MaskedTextBox('MaskedTextBox');
$maskedTextBox->promptChar('value');
?>

rounded

Sets a value controlling the border radius. Can also be set to the following string values: "none"; "small"; "medium"; "large" or "full".

Returns

\Kendo\UI\MaskedTextBox

Parameters

$value string

Example

<?php
$maskedTextBox = new \Kendo\UI\MaskedTextBox('MaskedTextBox');
$maskedTextBox->rounded('value');
?>

rules

Defines an object of custom mask rules.

Returns

\Kendo\UI\MaskedTextBox

Parameters

$value ``

size

Sets a value controlling size of the component. Can also be set to the following string values: "small"; "medium"; "large" or "none".

Returns

\Kendo\UI\MaskedTextBox

Parameters

$value string

Example

<?php
$maskedTextBox = new \Kendo\UI\MaskedTextBox('MaskedTextBox');
$maskedTextBox->size('value');
?>

suffixOptions

The configuration for the suffix adornment of the component.

Returns

\Kendo\UI\MaskedTextBox

Parameters

$value \Kendo\UI\MaskedTextBoxSuffixOptions|array

Example - using \Kendo\UI\MaskedTextBoxSuffixOptions

<?php
$maskedTextBox = new \Kendo\UI\MaskedTextBox('MaskedTextBox');
$suffixOptions = new \Kendo\UI\MaskedTextBoxSuffixOptions();
$icon = 'value';
$suffixOptions->icon($icon);
$maskedTextBox->suffixOptions($suffixOptions);
?>

Example - using array

<?php
$maskedTextBox = new \Kendo\UI\MaskedTextBox('MaskedTextBox');
$icon = 'value';
$maskedTextBox->suffixOptions(array('icon' => $icon));
?>

unmaskOnPost

Specifies whether the widget will unmask the input value on form post (available since Q1 2015).

Returns

\Kendo\UI\MaskedTextBox

Parameters

$value boolean

Example

<?php
$maskedTextBox = new \Kendo\UI\MaskedTextBox('MaskedTextBox');
$maskedTextBox->unmaskOnPost(true);
?>

value

Specifies the value of the MaskedTextBox widget.

Returns

\Kendo\UI\MaskedTextBox

Parameters

$value string

Example

<?php
$maskedTextBox = new \Kendo\UI\MaskedTextBox('MaskedTextBox');
$maskedTextBox->value('value');
?>
In this article
Not finding the help you need?