HTML:
<form id="myForm" >
<input id="oknovo" type="submit" value="OK & Novo" />
<input id="okfechar" type="submit" value="OK & Fechar" />
</form>
JS:
$("#myForm").submit(function(event){
var botao=$("input[type=submit][clicked=true]").id;
alert(botao);
});
How do I identify which of the buttons was clicked to submit the form?
I've also checked this
And tried this:
var botao=$("input[type=submit][clicked=true]").val();
But I always get "undefined".