or alternativesly, if that text box is empty, I want to disable that button. I try that, but it does not work too.
#ui.R
shinyjs::useShinyjs()
uiOutput("SaveData")
textInput("Barcode", h4("Scan and press Save Data button"))
# server.R
output$SaveData <- renderUI({
tagList(
bsModal("modalSaveData", "Save Data", "save_tmp_data", size = "small",wellPanel(
h3('Are you sure you want to save the data?'),
actionButton("save_data", "Save"),
actionButton("cancel_data", "Cancel")
)),
actionButton('save_tmp_data','Save Data')
)
})
observe({
input$Barcode
if (input$Barcode == '') {
shinyjs::disable("save_tmp_data")
}
})