jQuery function triggers for a button but not another?
<p><strong>EDITED</strong></p>

<p>Hi,</p>

<p>I have 2 buttons calling the same function clear_form(). In my clear_form() function I have placed an alert() at the end of the code to see if it is triggered for both buttons.</p>

<p>The stange thing is I can see the alert for both buttons but the clear_form() function only clears the form for the #clear_all_btn button.</p>

<pre><code>// Clear form trigger.
$('#clear_all_btn').click(function()
{
    $('#form_id').val('0');
    clear_form('#form1');
});

//Delete button trigger.
$('#delete_form_btn').click(function()
{
    $('#form_id').val('0');
    clear_form('#form1');       
});

function clear_form(form)
{
// Remove any validation errors from last request.
$('.form_validation').remove();
$('.error').removeClass('error');

$('#wrap_escrow').hide();

$(':input',form)
 .not(':button, :submit, :reset, :hidden')
 .removeAttr('checked')
 .removeAttr('selected');

 remove_all_accounts();

 alert('cleard form');
}

&lt;form id="form1"&gt;
   ....
  &lt;input type="button" name="delete_form_btn" id="delete_form_btn" value="Delete" /&gt;
  &lt;input type="button" name="clear_all_btn" id="clear_all_btn" value="Clear Form" /&gt;
&lt;/form&gt;
</code></pre>

<p>Anyone help me out on this?</p>

<p>Thanks</p>
