TextInputView

Description
The TextInput view displays an editable text box.
Documentation
Library path
splunkjs/mvc/textinputview
Simple XML wrapper
Properties
Name | Default value | Description |
id | | Required. The unique ID for this control. |
default | | The value to display on startup. |
disabled | false | Indicates whether to disable the view. |
type | "text" | The type of text field. To display characters as asterisks (*), set this value to "password". |
value | | The value of the text field. |
Methods
Name | Description |
render | Draws the view to the screen. Called only when you create the view manually in JavaScript. |
val | Returns the view's value if passed no parameters. Sets the view's value if passed a single parameter. |
Event
Name | Description |
change | Fired when the text value changes. |
Example (Django tag)
{% textinput id="example-textinput" value="$myTextValue$"|token_safe default="type here" %}
Example (JavaScript)
<script>
var deps = [
"splunkjs/ready!",
"splunkjs/mvc/textinputview"
];
require(deps, function(mvc) {
var TextInputView = require("splunkjs/mvc/textinputview");
// Instantiate components
new TextInputView({
id: "example-textinput",
value: mvc.tokenSafe("$myTextValue$"),
default: "type here",
el: $("#mytextinputview")
}).render();
});
</script>
Code examples