ShinyForm can be used to include forms in your website. Create
a ShinyForm object anywhere in your application by
defining all the inputs (possibly adding validators) and by
specifying callback onSuccess and onError functions.
idUnique form id which can be used with Shiny input.
elementsA list of ShinyForm input elements.
onSuccessA function with to be run on valid submission, see details.
onErrorA function with to be run on invalid submission, see details.
submitA submit Action button/link.
new()Initialises a ShinyForm.
ShinyForm$new(id, submit, onSuccess, onError, ...)
idUnique form identifier.
submitSubmit button label.
onSuccessFunction to be ran on successful validation.
onErrorFunction to be ran on unsuccesful validation.
...A list of validated Shiny inputs.
ui()Returns the form's UI. To be used inside your App's UI.
ShinyForm$ui()
server()Form logic. To be inserted into your App's server function.
Will validate form upon hitting the "Submit" button and run the `onSuccess` or `onError` function depending on whether the form is valid.
ShinyForm$server(input, output)
inputShiny input.
outputShiny output.
getValue()Returns value of the input element with a given ID.
ShinyForm$getValue(input, inputId)
inputShiny input.
inputIdID of the input whose value is to be returned.
clone()The objects of this class are cloneable with this method.
ShinyForm$clone(deep = FALSE)
deepWhether to make a deep clone.
Parameters onSuccess and onError passed to the constructor
should be functions with signatures function(self, input, output),
where `self` will refer to the form itself, while input and
output will be the usual Shiny objects.