Due to some logic in the ui in shinyCaptcha, I am unable to get conditionalPanel working along with it in my sidebarPanel.
Without shinyCaptcha, conditionalPanel works.
This is my code: (you will need to generate and enter a sitekey to run this :| )
# setup -------------------------------------------------------------------
library(shiny)
library(shinyjs)
library(leaflet)
library(data.table)
library(shinyCAPTCHA)
# Define UI for application
ui <- fluidPage(
div(h1("Application Title"),
h3("Application description"),align = "center"),
# Sidebar with a slider input for number of bins
sidebarLayout(
sidebarPanel(
# div(
h4("Register/Request for a new site"),
shinyjs::useShinyjs(),
radioButtons("registerorrequest",
"Register or Request: ",
choiceValues = list("register","request"),
choiceNames = c(
"Register your entity",
"Request for an entity"
),
selected = NULL),
conditionalPanel(
condition = "input.registerorrequest == 'register'",
numericInput("A","Input A for register",value = 0),
radioButtons("B","Input B for register: ",
choices = c(
"X",
"Y",
"Z",
"Other"
),selected = NULL),
radioButtons("C", "Input C for register: ",
choices = c(
"more choices",
"other choices"),selected = NULL),
radioButtons("D","Input D for register:",
choices = c("Yes","No"),selected = NULL)
),
conditionalPanel(
condition = "input.registerorrequest == 'request'",
radioButtons("P", "Input P for request: ",
choices = c(
"some choices",
"some more choices"),selected = NULL),
),
div(textInput("additionalinput","Any additional input",value = ""),
recaptchaUI("test", sitekey = "enterSitekey"),
uiOutput("humansOnly"),
style = "font-family:Arial"),
width = 4
),
# Show a plot of the generated distribution
mainPanel()))
# Define server logic
server <- function(input, output) {}
# Run the application
shinyApp(ui = ui, server = server)
Any help to solve this would be wonderful.