0

Can a button has two actions at the same time? 1- go to another page 2- reset all inputs in both pages I am using Intel XDK

function register_event_handlers()
 {

        /* button  Grupp 1 */
    $(document).on("click", ".uib_w_8", function(evt)
    {
        /* your code goes here */
         activate_page("#grupp1");
        document.getElementById("date1").reset();
                 document.getElementById("date2").reset();
                 document.getElementById("dag1").reset();
                 document.getElementById("dag2").reset();
                 document.getElementById("Arbetar1").reset();
                 document.getElementById("Arbetar2").reset();
                 document.getElementById("start1").reset();
                 document.getElementById("start2").reset();
                document.getElementById("slut1").reset();
                 document.getElementById("slut2").reset();
         return false;
         
    });
 }
 document.addEventListener("app.Ready", register_event_handlers, false);
})();
majed
  • 55
  • 8
  • http://stackoverflow.com/questions/14614334/one-form-one-submission-button-but-two-actions... Go here.. – Ashwin Golani Mar 20 '17 at 08:12
  • I can not use onClick="document.location.href='some/page'" /> in intel xdk. Ican only use activate_page as above in my js – majed Mar 20 '17 at 08:36
  • That was an example to use two actions on one button.. Chagethe code according to your requirment in both functions – Ashwin Golani Mar 20 '17 at 08:38

1 Answers1

1

Set the button to run a custom script. In your custom script, just do this

$(document).on("click", "#mybutton", function(evt) {
   //this does the reset
   document.getElementById("date1").reset();
   //this goes to that page
   activate_page("#grupp1");
   return false;
});
Jackson Ng
  • 368
  • 2
  • 16