diff --git a/include/class.forms.php b/include/class.forms.php
index 4eeed67e73c36e51ae944873698a701eb34b4a1e..add154b01cbfa138e7dba0a23f04b0246d4350cc 100644
--- a/include/class.forms.php
+++ b/include/class.forms.php
@@ -146,12 +146,17 @@ class FormField {
         ),
     );
     static $more_types = array();
+    static $uid = 100;
 
     function __construct($options=array()) {
-        static $uid = 100;
         $this->ht = array_merge($this->ht, $options);
         if (!isset($this->ht['id']))
-            $this->ht['id'] = $uid++;
+            $this->ht['id'] = self::$uid++;
+    }
+
+    function __clone() {
+        $this->_widget = null;
+        $this->ht['id'] = self::$uid++;
     }
 
     static function addFieldTypes($group, $callable) {