Submiting form after animation

Submiting form after animation

Hello

I have a small problem with a form.
After i click on a submit button a small animation starts, i would like to submit form after animation but nothing is working. I tried different methods and i also checked html for errors.
Code of function:
  1. $(document).ready(function(){
  2.     $("#button").click(function() {
  3.         var productX        = $("#first").offset().left;
  4.         var productY        = $("#first").offset().top;
  5.         var basketX         = $("#basket").offset().left+15;
  6.         var basketY         = $("#basket").offset().top+20;
  7.         var gotoX           = basketX - productX;
  8.         var gotoY           = basketY - productY;
  9.         var newImageWidth   = $("#first img").width() / 3;
  10.         var newImageHeight  = $("#first img").height() / 3;
  11.         $("#first img")
  12.         .clone()
  13.         .prependTo("#first")
  14.         .css({'position' : 'absolute'})
  15.         .animate({opacity: 0.9}, 100 )
  16.         .animate({opacity: 0.6, marginLeft: gotoX, marginTop: gotoY, width: newImageWidth, height: newImageHeight}, 1200, function(){
  17.             $("#detailstext").submit(); //form id
  18.         });
  19.         return false;
  20.     });
  21. });
I also tried
  1. $("form_id").post(0).submit();
but i got error:
  1. $("form_id").post is not a function