Getting started with the Form API and Ajax framework
There is a module for submitting forms with Ajax.


  Provides AJAX comments to Drupal sites. Features:  
  
  
  Makes AJAX submits
  Allows replies to comments on the actual thread page
  AJAX comments deleting
  Works with CAPTCHA
  Cool jQuery sliding