Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions R/shinyform.R
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,11 @@ formServerHelper <- function(input, output, session, formInfo) {
write.csv(loadData(formInfo$storage), file, row.names = FALSE)
}
)
return(
reactive({
input$submit
})
)
}

createFormInfo <- function(id, questions, storage, name, multiple = TRUE,
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,16 @@ shinyApp(ui = ui, server = server)

Of course you could put more stuff in the app, but this is the beauty of it, the form is a "module" that you can just plug into any Shiny app anywhere you want. Every time you submit a response, it will be saved as a file in the `responses` directory. This example is the most basic usage.

Additionally, `formServer` may be used like a reactive function that sends a signal when the form is submit. This is useful for refreshing tables after a form is filled out.

```r
trigger <- formServer(basicInfoForm)
output$my_table <- renderDataTable({
trigger()
mtcars
})
```

#### Current features

- Responses are saved to local files
Expand Down