sending request and parameter when submit from using ajax
<p>I want to submit a form using jquery <code>.post()</code>. I want to send all the input names in addition to another parameter, in there any way to send data and the request?</p>

<pre><code> $.post("RegistrarManagementServlet",{"option":"cancelRequest"},function(){
                alert("hi");
            });
</code></pre>

<p>here is how we submit the request</p>

<pre><code>  $.post("RegistrarManagementServlet",request,function(){
                alert("hi");
            });
</code></pre>

<p>I want to send all the data in the form (in the normal post request) in addition to option parameter, how can I make it?</p>

<p><strong>EDIT</strong></p>

<p>where should I define the request as function parameter, since the code occurs after confirmation dialog appear</p>

<pre><code>$('#cancelRequest').click(function(event){
    event.preventDefault();
    jConfirm('Are you sure to delete registrar request?', 'Confirmation Dialog', function(result) {

        if(result == true){
            request.cancelRequest="cancelRequest";   //request is not defiend
            $.post("RegistrarManagementServlet",request,function(){
                alert("hi");
            });
          }

    });
</code></pre>
