Anna Bokovskaya Anna Bokovskaya - 4 years ago 130
HTML Question

Input button does not work in my shiny app

I created a shiny app. But the input button is not reactive.
Here is a snapshot of the code:


quit()##Their is another function here, i wrote quit() just for ilustration


<INPUT style="background-color:#143d4d;color:white;" onclick="newDoc(this.value)" TYPE="button" id="RunModel" class="btn btn-primary" VALUE="Run Model"/>

But unfortunately this button is not reactive. I searched on the web and I found that it should work. What happened?

Answer Source

I figure it out how to do it.
with observeEvent method. here is a snapshot of the code:

  observeEvent(input$RunModel,label ="Write a label for debugging",function() {

Now when i click the 'RunModel' button it will active the observeEvent. And quit the app.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download