shinysurveys icon indicating copy to clipboard operation
shinysurveys copied to clipboard

radioMatrixInput with different selected for each row

Open bcaessens opened this issue 3 years ago • 0 comments

Hi,

First of all, thank you very much for this package. I am currently just using the radioMatrixInput. However, I want to allow people to take the survey in parts. So autosaving and loading responses given on different times. To implement this, I need to set a selected value for each row in the radioMatrixInput.

I tried to do this from the example:

radioMatrixInput("matInput", responseItems = c("Love sushi?", "Love chocolate?"), choices = c("Disagree", "Neutral", "Agree"), selected=c("Agree","Neutral"), .required=T)

The intended output is then the radiomatrix with Agree checked on item 1, and Neutral checked on item 2. However, no items are checked in the browser, and on inspection, in the HTML, all radiobuttons have the attribute set to checked.

I think I understand this, as in the code you set the attribute like value %in% select, so all get checked. However, I don't see a quick way around this.

Any suggestions. Bernie.

bcaessens avatar Dec 08 '21 19:12 bcaessens