textInput placeholder that would disappear once clicked on textbox?

355 views
Skip to first unread message

Bernhard Klingenberg

unread,
Sep 23, 2015, 7:37:04 PM9/23/15
to Shiny - Web Framework for R
Is there a way for the text (set via 'value=') to disappear when clicking on a textbox created via textInput? I think the term for this is placeholder.

For example, below I would like the text to go away once I click on the textbox:

ui <- fluidPage(
  sidebarLayout(
    sidebarPanel(
      textInput("mytext", "Enter Label:", value="This should go away on click")
    ),
    mainPanel(textOutput("showtext"))
  )
)
server <- function(input, output) {
  output$showtext <- renderText(input$mytext)
}

shinyApp(ui = ui, server = server)


So, I'm looking for a behavior similar to what you get with selectInput, where once a selection is made the text in the textbox disappears.

Thanks,

Bernhard

Joe Cheng

unread,
Sep 23, 2015, 9:29:39 PM9/23/15
to Bernhard Klingenberg, Shiny - Web Framework for R
--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shiny-discuss/69c9a5d9-333e-4e1f-bb7c-c4b3cc3491b9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages