Index: processFormAction.php
===================================================================
--- processFormAction.php	(revision 23378)
+++ processFormAction.php	(working copy)
@@ -9,18 +9,28 @@
 
       $this->dispatcher->notify(new sfEvent($this, 'admin.save_object', array('object' => $<?php echo $this->getSingularName() ?>)));
 
-      if ($request->hasParameter('_save_and_add'))
-      {
-        $this->getUser()->setFlash('notice', $notice.' You can add another one below.');
-
-        $this->redirect('@<?php echo $this->getUrlForAction('new') ?>');
+      if ($request->isXmlHttpRequest()) {
+        // Do something else instead
+        if (!is_array($notice)) {
+          $notice = array($notice);
+        }
+        
+        return $this->renderText(json_encode($notice));
+      } else {
+	      if ($request->hasParameter('_save_and_add'))
+	      {
+	        $this->getUser()->setFlash('notice', $notice.' You can add another one below.');
+	
+	        $this->redirect('@<?php echo $this->getUrlForAction('new') ?>');
+	      }
+	      else
+	      {
+	        $this->getUser()->setFlash('notice', $notice);
+	
+	        $this->redirect(array('sf_route' => '<?php echo $this->getUrlForAction('edit') ?>', 'sf_subject' => $<?php echo $this->getSingularName() ?>));
+	      }
       }
-      else
-      {
-        $this->getUser()->setFlash('notice', $notice);
 
-        $this->redirect(array('sf_route' => '<?php echo $this->getUrlForAction('edit') ?>', 'sf_subject' => $<?php echo $this->getSingularName() ?>));
-      }
     }
     else
     {

