Index: CKEditor/branches/versions/3.3.x/CHANGES.html
===================================================================
--- CKEditor/branches/versions/3.3.x/CHANGES.html	(revision 5278)
+++ CKEditor/branches/versions/3.3.x/CHANGES.html	(revision 5295)
@@ -45,5 +45,5 @@
 		Fixed issues:</p>
 	<ul>
-		<li></li>
+		<li><a href="http://dev.fckeditor.net/ticket/4056">#4056</a> : Fixed hiddenfield problem.</li>
 	</ul>
 	<h3>
Index: CKEditor/branches/versions/3.3.x/_source/plugins/forms/dialogs/hiddenfield.js
===================================================================
--- CKEditor/branches/versions/3.3.x/_source/plugins/forms/dialogs/hiddenfield.js	(revision 5278)
+++ CKEditor/branches/versions/3.3.x/_source/plugins/forms/dialogs/hiddenfield.js	(revision 5295)
@@ -7,4 +7,5 @@
 	return {
 		title : editor.lang.hidden.title,
+		hiddenField : null,
 		minWidth : 350,
 		minHeight : 110,
@@ -13,27 +14,34 @@
 			delete this.hiddenField;
 
-			var element = this.getParentEditor().getSelection().getSelectedElement();
-			if ( element && element.getName() == "input" && element.getAttribute( 'type' ) == "checkbox" )
+			var editor = this.getParentEditor(),
+				selection = editor.getSelection(),
+				element = selection.getSelectedElement();
+				
+			if ( element && element.getAttribute( '_cke_real_element_type' ) && element.getAttribute( '_cke_real_element_type' ) == 'hiddenfield' )
 			{
 				this.hiddenField = element;
+				element = editor.restoreRealElement( this.hiddenField );
 				this.setupContent( element );
+				selection.selectElement( this.hiddenField );
 			}
 		},
 		onOk : function()
 		{
-			var editor,
-				element = this.hiddenField,
-				isInsertMode = !element;
+			var name = this.getValueOf( 'info', '_cke_saved_name' ),
+				value = this.getValueOf( 'info', 'value' ),
+				editor = this.getParentEditor(),
+				element = CKEDITOR.env.ie ? editor.document.createElement( '<input name="' + CKEDITOR.tools.htmlEncode( name ) + '">' ) : editor.document.createElement( 'input' );
 
-			if ( isInsertMode )
+			element.setAttribute( 'type', 'hidden' );
+			this.commitContent( element );
+			var fakeElement = editor.createFakeElement( element, 'cke_hidden', 'hiddenfield' );
+			if ( !this.hiddenField )
+				editor.insertElement( fakeElement );
+			else
 			{
-				editor = this.getParentEditor();
-				element = editor.document.createElement( 'input' );
-				element.setAttribute( 'type', 'hidden' );
+				fakeElement.replace( this.hiddenField );
+				editor.getSelection().selectElement( fakeElement );
 			}
-
-			if ( isInsertMode )
-				editor.insertElement( element );
-			this.commitContent( element );
+			return true;
 		},
 		contents : [
@@ -59,8 +67,7 @@
 						{
 							if ( this.getValue() )
-								element.setAttribute( '_cke_saved_name', this.getValue() );
+								element.setAttribute( 'name', this.getValue() );
 							else
 							{
-								element.removeAttribute( '_cke_saved_name' );
 								element.removeAttribute( 'name' );
 							}
Index: CKEditor/branches/versions/3.3.x/_source/plugins/forms/plugin.js
===================================================================
--- CKEditor/branches/versions/3.3.x/_source/plugins/forms/plugin.js	(revision 5278)
+++ CKEditor/branches/versions/3.3.x/_source/plugins/forms/plugin.js	(revision 5295)
@@ -19,6 +19,17 @@
 				'border: 1px dotted #FF0000;' +
 				'padding: 2px;' +
+			'}\n' );
+		
+		editor.addCss(
+			'img.cke_hidden' + 
+			'{' +
+				'background-image: url(' + CKEDITOR.getUrl( this.path + 'images/hiddenfield.gif' ) + ');' + 
+				'background-position: center center;' + 
+				'background-repeat: no-repeat;' +
+				'border: 1px solid #a9a9a9;' +
+				'width: 16px;' +
+				'height: 16px;' +
 			'}' );
-
+		
 		// All buttons use the same code to register. So, to avoid
 		// duplications, let's use this tool function.
@@ -166,10 +177,11 @@
 	afterInit : function( editor )
 	{
+		var dataProcessor = editor.dataProcessor,
+			htmlFilter = dataProcessor && dataProcessor.htmlFilter,
+			dataFilter = dataProcessor && dataProcessor.dataFilter;
+		
 		// Cleanup certain IE form elements default values.
 		if ( CKEDITOR.env.ie )
 		{
-			var dataProcessor = editor.dataProcessor,
-				htmlFilter = dataProcessor && dataProcessor.htmlFilter;
-
 			htmlFilter && htmlFilter.addRules(
 			{
@@ -186,6 +198,21 @@
 			} );
 		}
+		
+		if ( dataFilter ) 
+		{ 
+			dataFilter.addRules( 
+			{ 
+				elements : 
+				{ 
+					input : function( element ) 
+					{ 
+						if ( element.attributes.type == 'hidden' ) 
+							return editor.createFakeParserElement( element, 'cke_hidden', 'hiddenfield' ); 
+					} 
+				} 
+			} ); 
+		} 
 	},
-	requires : [ 'image' ]
+	requires : [ 'image', 'fakeobjects' ]
 } );
 
