JQuery UI Dialog help with posting please

JQuery UI Dialog help with posting please

Hi Guys,

need some basic help please, im a total newbie so please bear with me.
I've got the following code in my customer.php file which brings a modal dialog box with a number of fields from my dialogcustomer div. At present my dialogcustomer div is contained in this page, is it at all possible to copy the contents of the dialogcustomer div in a separate php file called add_customer.php and the code underneath call that file and process the code, i.e. displaying my form.

Secondly, is it possible to use the $.post command to post the data to my customer_add_response.php page.

Any help would be much appreciated.

Many Thanks

Jalz


      $("#dialogcustomer").dialog({
         bgiframe: true,
         autoOpen: false,
         height: 500,
         modal: true,
         buttons: {
            'Add Customer': function() {
            
                  // I need to post the values of my form to customer_add_response.php;
                  $(this).dialog('close');
            },
            Cancel: function() {
               $(this).dialog('close');
            }
         },
         close: function() {
            allFields.val('').removeClass('ui-state-error');
         }
      });
      
      
      
      $('#customer').click(function() {
         $('#dialogcustomer').dialog('open');
      })
      .hover(
         function(){
            $(this).addClass("ui-state-hover");
         },
         function(){
            $(this).removeClass("ui-state-hover");
         }
      ).mousedown(function(){
         $(this).addClass("ui-state-active");
      })
      .mouseup(function(){
            $(this).removeClass("ui-state-active");
      });

   });
   </script>