dropdown_page | R Documentation |
Creates a page where the response is to be selected from a dropdown list.
dropdown_page(
label,
prompt,
choices,
alternative_choice = FALSE,
alternative_text = "Other (please state)",
save_answer = TRUE,
validate = dropdown_page.validate(alternative_choice, alternative_text),
on_complete = NULL,
next_button_text = "Next",
max_width_pixels = 200,
admin_ui = NULL
)
label |
Page label (character scalar). |
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 of choices for the participant. If names are provided, then these names will be used for display, whereas the values will be stored in the results. |
alternative_choice |
Whether or not to give the participant the option of providing a free-text response instead of selecting one of the dropdown options. |
alternative_text |
Prompt for the free-text box (only relevant
if |
save_answer |
Whether or not to save the answer. |
validate |
Optional validation function.
The argument list should include |
on_complete |
Optional function to execute on leaving the page
(after successful validation).
The argument list should include |
next_button_text |
Text to display on the next-page button (character scalar). |
max_width_pixels |
Maximum width of the response UI, in pixels. |
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.