jquery form submit with dialog and stay on page
I'm using the jquery dialog for showing a dialog when someone adds a product to their cart. My problem is that on the product page I have a form where someone can type a number of products to put in the cart. The form only submits '1' to the cart and not for example '5'. 
My code looks like this:

    $(document).ready(function(){
    $( "#dialog" ).dialog({
    autoOpen: false,
    show: "fade",
    hide: "fade",
    dialogClass: "modal",
    open: function(event, ui) {
      var dlg = $(this);
      setTimeout(function() {
        dlg.dialog("close");
      }, 2000);
      setTimeout(function() { window.location.reload();}, 500);
    },
    modal: true,
    opacity: 1
 
     });
  
    $( ".opener" ).bind("click", function(event) {
       event.preventDefault();
       $.get($(this).attr('href'), function(data, status) {
        $( "#dialog" ).dialog( "open" );
         return false;
         });
   
         });

And my form looks like this:

     <form class="formProduct" id="formProduct" action="{{ ('cart/add/' ~ product.vid) | url }}" method="post"> 
     // the action {{ ('cart/add/' ~ product.vid) | url }} produces a link like "http://www.shop.com/cart/add/123456"!!
            
     <input type="text" name="quantity" id="formProductQuantity" value="" /> 
     <a class="button blue opener" href="#" onclick="$('#formProduct').submit(); return false;" title=""><span>Add to cart</span></a>
     </form>



Can anybody help me with this?
jquery form submit with dialog and stay on page
===

I'm using the jquery dialog for showing a dialog when someone adds a product to their cart. My problem is that on the product page I have a form where someone can type a number of products to put in the cart. The form only submits '1' to the cart and not for example '5'. 
My code looks like this:

    $(document).ready(function(){
    $( "#dialog" ).dialog({
    autoOpen: false,
    show: "fade",
    hide: "fade",
    dialogClass: "modal",
    open: function(event, ui) {
      var dlg = $(this);
      setTimeout(function() {
        dlg.dialog("close");
      }, 2000);
      setTimeout(function() { window.location.reload();}, 500);
    },
    modal: true,
    opacity: 1
 
     });
  
    $( ".opener" ).bind("click", function(event) {
       event.preventDefault();
       $.get($(this).attr('href'), function(data, status) {
        $( "#dialog" ).dialog( "open" );
         return false;
         });
   
         });

And my form looks like this:

     <form class="formProduct" id="formProduct" action="{{ ('cart/add/' ~ product.vid) | url }}" method="post"> 
     // the action {{ ('cart/add/' ~ product.vid) | url }} produces a link like "http://www.shop.com/cart/add/123456"!!
            
     <input type="text" name="quantity" id="formProductQuantity" value="" /> 
     <a class="button blue opener" href="#" onclick="$('#formProduct').submit(); return false;" title=""><span>Add to cart</span></a>
     </form>



Can anybody help me with this?