checkbox_page | R Documentation |
Creates a checkbox page.
checkbox_page(
label,
prompt,
choices,
subprompt = "",
labels = NULL,
trigger_button_text = "Continue",
failed_validation_message = c(one = "Choose at least one answer!", all =
"Please check all boxes."),
force_answer = c("no", "one", "all", "first"),
javascript = "",
save_answer = TRUE,
hide_response_ui = FALSE,
response_ui_id = "response_ui",
on_complete = NULL,
admin_ui = NULL
)
label |
(Character scalar) Label for the current page. |
prompt |
Prompt to be displayed above the response choices.
Can be either a character scalar (e.g. "What is 2 + 2?") or an object of
class "shiny.tag", e.g. |
choices |
(Character vector) Choices for the participant. If unnamed, then these values will be used both for checkbox IDs and for checkbox labels. If named, then values will be used for checkbox IDs and names will be used for checkbox labels. |
subprompt |
(Character scalar) Optional additional text in bold letters below the prompt. |
labels |
Optional vector of labels for the checkbox choices.
If not |
trigger_button_text |
(Character scalar) Text for the trigger button. |
failed_validation_message |
(Named character vector) Text to be displayed when validation fails, names must match the validation type ("one" or "all"), see "force_answer". |
force_answer |
(Boolean scalar or character) Require at least one checkbox (value "one") or all checkboxes ("all") to be ticked. If no selection is required set to "no" (default). If boolean, this translate to option "one" (TRUE) or "no" (FALSE). |
javascript |
(Character scalar) JavaScript code to be added for controlling checkbox behaviour. |
save_answer |
(Boolean scalar) Whether or not to save the answer. |
hide_response_ui |
(Boolean scalar) Whether to begin with the response
interface hidden (it can be subsequently made visible through Javascript,
using the element ID as set in |
response_ui_id |
(Character scalar) HTML ID for the response user interface. |
on_complete |
Optional function to execute on leaving the page
(after successful validation).
The argument list should include |
admin_ui |
Optional UI component for the admin panel. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.