Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Restricting User on ability to chose maximum items from selectInput

Tags:

shiny

Shiny function selectInput() gives an option to select multiple items from the dropdown list with 'multiple = TRUE'

However I want to restrict user on how many items max can be chosen from underlying dropdown list.

Can you please suggest if that is possible with Shiny.

Appreciate for any pointer.

Thanks,

like image 375
Soma Avatar asked May 24 '17 00:05

Soma


1 Answers

You can do this if you define it as selectizeInput() instead of selectInput(), and use the options = list(maxItems = n) parameter.

For example

selectizeInput("select", "Select", LETTERS, options = list(maxItems = 4))
like image 60
DeanAttali Avatar answered Oct 20 '22 15:10

DeanAttali



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!