Submitting form data through a jQuery command
<p>I have an MVC project I'm working on, and am creating a set of different submit buttons, each which pass a different value to the controller on submission.</p>

<p>In my current code, I have the call to the submit function first create hidden input elements to pass the data I want, something like this:</p>

<pre><code>    $('#btnCreate').live('click', function () {
    $('#formIndex').submit(function (event) {
        $('#actions').append('&lt;input type="hidden" name="objectId" value="' + $('input[name="objectList"]').val() + '" /&gt;');
        $('#actions').append('&lt;input type="hidden" name="choice" value="create" /&gt;');
    });
});
</code></pre>

<p>I'm wondering if I can just pass the values of those hidden inputs as a set of parameters in the submit call, like you can do with the $.get, $.post, and $.ajax functions.  I've experimented but haven't seemed to hit on the right formula yet.</p>

<p>Thanks for your help!</p>
