views:

25

answers:

1

i have two button inside my form, i set them inside table:

<table id="status">
        <tr>
             <td>
                     <p align="center"><button id="accept">Accept</button></p>
             </td>
             <td>
                 <td>
                      <p align="center"><button id="reject">Reject</button></p>
                 </td>
             </td>
        </tr>
</table>

i have the hidden action like below:

<input name="action" value="newinputdata" type="hidden">

i want this code can manage two submit button inside form. or are you have any idea that i can use both of buttons for submiting the form?

A: 

You can submit a form with jQuery:

$(':button').click(function() {
    $('#myForm').submit();
});
fearofawhackplanet
is this code can make one form submitting by two submit buttons?
klox
Yes. Use as many buttons as you want. It's a Javascript form submit, so it doesn't make any difference which button triggers the method call.
fearofawhackplanet