link for jsfiddle: http://jsfiddle.net/6UWZQ/1
look at this direct link if you click on any line when deleting or editing and after canceling the click the button will remain highlighted (only in Firefox)
I make the buttons as follows:
$("input[type=submit]").addClass("abtn");
$("tbody a").addClass("abtn");
$(".abtn").button();
and I add a confirmation dialog for each form using the css class in the submit button, for example:
<script type="text/javascript">
var currentFormconfirm;
$(function () {
$("#dialog-confirm-confirm").dialog({
show: "drop",
hide: "fade",
resizable: false,
height: 220,
width: 400,
modal: true,
autoOpen: false,
buttons: {
'Yes': function () {
$(this).dialog('close');
currentFormconfirm.submit();
},
'Cancel': function () {
$(this).dialog('close');
}
}
});
$(".confirm").click(function () {
currentFormconfirm = $(this).closest('form');
$("#dialog-confirm-confirm").dialog('open');
return false;
});
});
</script>
<div id="dialog-confirm-confirm" title="Confirm dialog">
Are you sure you want to delete this foobar ?
</div>
and form:
<form action="/awesome/foobar/Delete/7" method="post" class="fr">
<input type="submit" class="confirm abtn ui-button ui-widget ui-state-default ui-corner-all" value="Delete" role="button" aria-disabled="false">
</form>
source
share