Description Usage Arguments Details Examples
Set the value of a textarea on a shiny application UI.
1 | updateTextareaInput(session, inputId, label = NULL, value = NULL)
|
session |
The |
inputId |
The id of the input object. |
label |
The label to set for the input object |
value |
The value to set for the input object. |
Although a textareaInput
doesn't exist in shiny it is possible to create one with HTML and update it using the shiny messaging system. This function appropriates the code from the shiny updateTextInput.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | # textarea can be created in UI with HTML:
HTML({"
<label for='inText'>Old label</label>
<textarea id='inText', class='textarea', placeholder= ''></textarea>"
})
## Not run:
# From ?updateTextInput
shinyServer(function(input, output, session) {
observe({
# We'll use the input$controller variable multiple times, so save it as x
# for convenience.
x <- input$controller
# This will change the value of input$inText, based on x
updateTextareaInput(session, "inText", value = paste("New text", x))
# Can also set the label, this time for input$inText2
updateTextareaInput(session, "inText2",
label = paste("New label", x),
value = paste("New text", x))
})
})
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.