I have an HTML button in Shiny that when clicked, calls the JavaScript function geocodeAddressStreet(...) in a .js file in the /www directory:
tags$body(tags$input(type = "button",
value = "Next",
id = "button1",
onClick = "geocodeAddressStreet(houseNumber,streetName,addressCity,addressState)"))),
However I cannot figure out how to get this button to call a second file when clicked, let's say foo.R. Both procedures run independently, but it seems like there's no way to add an inputId to an HTML element in Shiny. We currently have two different buttons, one of which calls R code and the other of which calls JavaScript code, but this is clearly an impractical solution.
server.rcan't you just set up anobserve()that will call the script when the button is clicked?inputIdthough? This button just has a standard HTML ID as far as I can tell.actionButtonshiny function?actionButton("name","This is a Button",onClick="geoCodeAddressStreet")