I have a form which as two buttons: cancel and submit
Here is an example page: http://www.problemio.com/problems/problem.php?problem_id=228
If you log in with this login: testing@problemio.com / testing
and then click on the comments tab, you will see some options to edit some of the comments. If you click edit, you get a form. How do I place the submit and cancel on the same line? And how do I k know which of the buttons was clicked?
I try to tell with this:
$('#add_comment').live('submit',function( )
{
alert($(this).val());
...
But that code doesn’t output anything for me.
Or maybe in case they press cancel another function can be called altogether?
Thanks!
Buttons don’t submit, they click. Forms submit. Just use type=”button”. You can give the button an ID and read it back as an attribute.