Skip to content

Instantly share code, notes, and snippets.

@benwilber
Created January 17, 2012 20:32
Show Gist options
  • Save benwilber/1628716 to your computer and use it in GitHub Desktop.
Save benwilber/1628716 to your computer and use it in GitHub Desktop.
finding button used to submit a form
dojo.connect(dojo.byId("id_form"), "onsubmit", function(event) {
dojo.query(event.target, ":active").forEach(function(node, idx, arr) {
if (node.id == "id_button1") {
dojo.stopEvent(event);
// do something special of button1 is clicked
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment