Editable textboxes

shiny
text

#1

I'm trying to add an editable textbox to my shiny app, the text box I need should be editable and deletable

library(shiny)

ui <- shinyUI(fluidPage(

sidebarPanel(

actionButton("add_btn", "Add Textbox"),
actionButton("rm_btn", "Remove Textbox")

),

mainPanel(uiOutput("textbox_ui"))

))

server <- shinyServer(function(input, output, session) {

Track the number of input boxes to render

counter <- reactiveValues(n = 0)

observeEvent(input$add_btn, {counter$n <- counter$n + 1})
observeEvent(input$rm_btn, {
if (counter$n > 0) counter$n <- counter$n - 1
})

textboxes <- reactive({

n <- counter$n

if (n > 0) {
  lapply(seq_len(n), function(i) {
    textInput(inputId = paste0("textin", i),
              label = paste0("Textbox", i), value = "Hello World!")
  })
}

})

output$textbox_ui <- renderUI({ textboxes() })

})

shinyApp(ui, server)

I came across the above code but I need to have a flexible box as in the below code

library(shiny)
ui <- fluidPage(

withTags(
div(
textarea(id = "response2",
class = "form-control shiny-bound-input",
style = "width: 300px; height: 34px")
)
)

)

server<-function(input, output, session) {
output$out <- renderText({
input$response2
})
}

shinyApp(ui = ui, server = server)

Also would it be possible to lock in the text with a save button and an edit button to change it later on ?


Create an editable text box in R shiny
#2

I'm trying to create a textbox in a shiny app wherein the box appears whenever the click clicks on "create box" and the text that he enters is saved but also editable and delete-able

I'm tryng to mimic something like this

Here's a snapshot from my shiny app

2

I need a text box underneath the geomap and the two charts, the text box needs to be editable and deletable

I went through various forums but failed to find any help