New to Telerik UI for PHP? Download free 30-day trial

\Kendo\UI\TextBox

A PHP wrapper for Kendo UI TextBox.

Inherits from \Kendo\UI\Widget.

Usage

To use TextBox 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 TextBox

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

// Configure it
$textBox->enable(true)

// Output it

echo $textBox->render();
?>

Methods

change

Fired when the value of the widget is changed by the user.The event handler function context (available via the this keyword) will be set to the widget instance. For additional information check the change event documentation.

Returns

\Kendo\UI\TextBox

Parameters

$value string|\Kendo\JavaScriptFunction

Example - using string which defines a JavaScript function

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

Example - using string which defines a JavaScript name

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

Example - using \Kendo\JavaScriptFunction

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

enable

If set to false, the widget will be disabled and will not allow user input. The widget is enabled by default and allows user input.

Returns

\Kendo\UI\TextBox

Parameters

$value boolean

Example

<?php
$textBox = new \Kendo\UI\TextBox('TextBox');
$textBox->enable(true);
?>

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\TextBox

Parameters

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

Example - using string

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

Example - using \Kendo\JavaScriptFunction

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

Example - using \Kendo\UI\TextBoxLabel

<?php
$textBox = new \Kendo\UI\TextBox('TextBox');
$label = new \Kendo\UI\TextBoxLabel();
$content = 'value';
$label->content($content);
$textBox->label($label);
?>

Example - using array

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

placeholder

The hint displayed by the widget when it is empty. Not set by default.

Returns

\Kendo\UI\TextBox

Parameters

$value string

Example

<?php
$textBox = new \Kendo\UI\TextBox('TextBox');
$textBox->placeholder('value');
?>

readonly

If set to true, the widget will be readonly and will not allow user input. The widget is not readonly by default and allows user input.

Returns

\Kendo\UI\TextBox

Parameters

$value boolean

Example

<?php
$textBox = new \Kendo\UI\TextBox('TextBox');
$textBox->readonly(true);
?>

value

The value of the widget.

Returns

\Kendo\UI\TextBox

Parameters

$value string

Example

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