Multiple buttons on "form"ized table.
Multiple buttons on "form"ized table.
I was mucking with the "Submit form with elements in a table" example. I was able to add a second button but am unclear how to distinguish them apart via:
[code]$('#form').submit( function()...)[/code] Is there a quick example someone can point me to?
[code]$('#form').submit( function()...)[/code] Is there a quick example someone can point me to?
This discussion has been closed.
Replies
Still trying to figure out a solution. The problem is that the tag #form in the example is tied to the form, thus if you click any button it will trigger the same code. However, when I moved the ID to the button, nothing happened via:
[code] $(document).ready(function() {
$('#edit2').bind('submit', function() {
var sData = $('input', oTable.fnGetNodes()).serialize();
alert( "The following data XXX have been submitted to the server: \n\n"+sData );
return false;
} );
$('#delete2').bind('submit', function() {
var sData = $('input', oTable.fnGetNodes()).serialize();
alert( "The following data would have been submitted to the server: \n\n"+sData );
return false;
} );
[/code]
and
[code]
Edit Selected
Delete Selected
[/code]
Any idea on how to have two buttons on the same table? Or at least distinguish the buttons within the function called?
Allan