Index: /CKEditor/trunk/_source/core/dom/element.js
===================================================================
--- /CKEditor/trunk/_source/core/dom/element.js	(revision 3406)
+++ /CKEditor/trunk/_source/core/dom/element.js	(revision 3407)
@@ -422,4 +422,8 @@
 							break;
 
+						case 'checked':
+							return this.$.checked;
+							break;
+
 						case 'style':
 							// IE does not return inline styles via getAttribute(). See #2947.
@@ -829,31 +833,4 @@
 		},
 
-		copyAttributes : function( target, skip )
-		{
-			skip || ( skip = {} );
-			var attributes = this.$.attributes;
-
-			for ( var n = 0 ; n < attributes.length ; n++ )
-			{
-				var attr = attributes[n];
-
-				if ( attr.specified )
-				{
-					var attrName = attr.nodeName;
-					if ( attrName in skip )
-						continue;
-
-					var attrValue = this.getAttribute( attrName );
-					if ( !attrValue )
-						attrValue = attr.nodeValue;
-
-					target.setAttribute( attrName, attrValue );
-				}
-			}
-
-			if ( this.$.style.cssText !== '' )
-				target.$.style.cssText = this.$.style.cssText;
-		},
-
 		/**
 		 * Shows this element (display it).
@@ -900,4 +877,6 @@
 					else if ( name == 'tabindex' )	// Case sensitive.
 						this.$.tabIndex = value;
+					else if ( name == 'checked' )
+						this.$.checked = value;
 					else
 						standard.apply( this, arguments );
@@ -1282,5 +1261,7 @@
 				var attribute = attributes[n];
 
-				if ( attribute.specified )
+				// IE BUG: value attribute is never specified even if it exists.
+				if ( attribute.specified ||
+				  ( CKEDITOR.env.ie && attribute.nodeValue && attribute.nodeName.toLowerCase() == 'value' ) )
 				{
 					var attrName = attribute.nodeName;
Index: /CKEditor/trunk/_source/plugins/forms/dialogs/button.js
===================================================================
--- /CKEditor/trunk/_source/plugins/forms/dialogs/button.js	(revision 3406)
+++ /CKEditor/trunk/_source/plugins/forms/dialogs/button.js	(revision 3407)
@@ -33,8 +33,8 @@
 				element = editor.document.createElement( 'input' );
 			}
-			this.commitContent( element );
 
 			if ( isInsertMode )
 				editor.insertElement( element );
+			this.commitContent( { element : element } );
 		},
 		contents : [
@@ -45,5 +45,5 @@
 				elements : [
 					{
-						id : 'txtName',
+						id : '_cke_saved_name',
 						type : 'text',
 						label : editor.lang.common.name,
@@ -51,15 +51,24 @@
 						setup : function( element )
 						{
-							this.setValue( element.getAttribute( 'name' ) );
-							this.focus();
+							this.setValue(
+									element.getAttribute( '_cke_saved_name' ) ||
+									element.getAttribute( 'name' ) ||
+									'' );
 						},
-						commit : function( element )
+						commit : function( data )
 						{
-							if ( this.getValue() || this.isChanged() )
-								element.setAttribute( 'name', this.getValue() );
+							var element = data.element;
+
+							if ( this.getValue() )
+								element.setAttribute( '_cke_saved_name', this.getValue() );
+							else
+							{
+								element.removeAttribute( '_cke_saved_name' );
+								element.removeAttribute( 'name' );
+							}
 						}
 					},
 					{
-						id : 'txtValue',
+						id : 'value',
 						type : 'text',
 						label : editor.lang.button.text,
@@ -68,14 +77,18 @@
 						setup : function( element )
 						{
-							this.setValue( element.getAttribute( 'value' ) );
+							this.setValue( element.getAttribute( 'value' ) || '' );
 						},
-						commit : function( element )
+						commit : function( data )
 						{
-							if ( this.getValue() || this.isChanged() )
+							var element = data.element;
+
+							if ( this.getValue() )
 								element.setAttribute( 'value', this.getValue() );
+							else
+								element.removeAttribute( 'value' );
 						}
 					},
 					{
-						id : 'txtType',
+						id : 'type',
 						type : 'select',
 						label : editor.lang.button.type,
@@ -90,9 +103,27 @@
 						setup : function( element )
 						{
-							this.setValue( element.getAttribute( 'type' ) );
+							this.setValue( element.getAttribute( 'type' ) || '' );
 						},
-						commit : function( element )
+						commit : function( data )
 						{
-							element.setAttribute( 'type', this.getValue() );
+							var element = data.element;
+
+							if ( CKEDITOR.env.ie )
+							{
+								var elementType = element.getAttribute( 'type' );
+								var currentType = this.getValue();
+
+								if ( currentType != elementType )
+								{
+									var replace = CKEDITOR.dom.element.createFromHtml( '<input type="' + currentType +
+										'"></input>', editor.document );
+									element.copyAttributes( replace, { type : 1 } );
+									replace.replace( element );
+									editor.getSelection().selectElement( replace );
+									data.element = replace;
+								}
+							}
+							else
+								element.setAttribute( 'type', this.getValue() );
 						}
 					}
Index: /CKEditor/trunk/_source/plugins/forms/dialogs/checkbox.js
===================================================================
--- /CKEditor/trunk/_source/plugins/forms/dialogs/checkbox.js	(revision 3406)
+++ /CKEditor/trunk/_source/plugins/forms/dialogs/checkbox.js	(revision 3407)
@@ -32,8 +32,7 @@
 			}
 
-			this.commitContent( element );
-
 			if ( isInsertMode )
 				editor.insertElement( element );
+			this.commitContent( { element : element } );
 		},
 		contents : [
@@ -52,10 +51,18 @@
 						setup : function( element )
 						{
-							this.setValue( element.getAttribute( 'name' ) );
+							this.setValue( element.getAttribute( '_cke_saved_name' ) || '' );
 						},
-						commit : function( element )
+						commit : function( data )
 						{
-							if ( this.getValue() || this.isChanged() )
-								element.setAttribute( 'name', this.getValue() );
+							var element = data.element;
+
+							// IE failed to update 'name' property on input elements, protect it now.
+							if ( this.getValue() )
+								element.setAttribute( '_cke_saved_name', this.getValue() );
+							else
+							{
+								element.removeAttribute( '_cke_saved_name' );
+								element.removeAttribute( 'name' );
+							}
 						}
 					},
@@ -68,10 +75,14 @@
 						setup : function( element )
 						{
-							this.setValue( element.getAttribute( 'value' ) );
+							this.setValue( element.getAttribute( 'value' ) || '' );
 						},
-						commit : function( element )
+						commit : function( data )
 						{
-							if ( this.getValue() || this.isChanged() )
+							var element = data.element;
+
+							if ( this.getValue() )
 								element.setAttribute( 'value', this.getValue() );
+							else
+								element.removeAttribute( 'value' );
 						}
 					},
@@ -87,8 +98,31 @@
 							this.setValue( element.getAttribute( 'checked' ) );
 						},
-						commit : function( element )
+						commit : function( data )
 						{
-							if ( this.getValue() || this.isChanged() )
-								element.setAttribute( 'checked', this.getValue() );
+							var element = data.element;
+
+							if ( CKEDITOR.env.ie )
+							{
+								var isElementChecked = !!element.getAttribute( 'checked' );
+								var isChecked = !!this.getValue();
+
+								if ( isElementChecked != isChecked )
+								{
+									var replace = CKEDITOR.dom.element.createFromHtml( '<input type="checkbox"'
+										   + ( isChecked ? ' checked="checked"' : '' )
+										   + '></input>', editor.document );
+									element.copyAttributes( replace, { type : 1, checked : 1 } );
+									replace.replace( element );
+									editor.getSelection().selectElement( replace );
+									data.element = replace;
+								}
+							}
+							else
+							{
+								if ( this.getValue() )
+									element.setAttribute( 'checked', this.getValue() );
+								else
+									element.removeAttribute( 'checked' );
+							}
 						}
 					}
Index: /CKEditor/trunk/_source/plugins/forms/dialogs/form.js
===================================================================
--- /CKEditor/trunk/_source/plugins/forms/dialogs/form.js	(revision 3406)
+++ /CKEditor/trunk/_source/plugins/forms/dialogs/form.js	(revision 3407)
@@ -5,4 +5,13 @@
 CKEDITOR.dialog.add( 'form', function( editor )
 {
+	var autoAttributes =
+	{
+		action : 1,
+		id : 1,
+		method : 1,
+		encoding : 1,
+		target : 1
+	};
+
 	return {
 		title : editor.lang.form.title,
@@ -11,9 +20,10 @@
 		onShow : function()
 		{
-			var element = this.getParentEditor().getSelection().getSelectedElement();
-			if ( element && element.getName() == "form" )
+			var element = this.getParentEditor().getSelection().getStartElement();
+			var form = element && element.getAscendant( 'form', true );
+			if ( form )
 			{
-				this._element = element;
-				this.setupContent( element );
+				this._element = form;
+				this.setupContent( form );
 			}
 		},
@@ -30,8 +40,32 @@
 				element.append( editor.document.createElement( 'br' ) );
 			}
-			this.commitContent( element );
 
 			if ( isInsertMode )
 				editor.insertElement( element );
+			this.commitContent( element );
+		},
+		onLoad : function()
+		{
+			function autoSetup( element )
+			{
+				this.setValue( element.getAttribute( this.id ) || '' );
+			}
+
+			function autoCommit( element )
+			{
+				if ( this.getValue() )
+					element.setAttribute( this.id, this.getValue() );
+				else
+					element.removeAttribute( this.id );
+			}
+
+			this.foreach( function( contentObj )
+				{
+					if ( autoAttributes[ contentObj.id ] )
+					{
+						contentObj.setup = autoSetup;
+						contentObj.commit = autoCommit;
+					}
+				} );
 		},
 		contents : [
@@ -49,28 +83,25 @@
 						setup : function( element )
 						{
-							this.setValue( element.getAttribute( 'name' ) );
-							this.focus();
+							this.setValue( element.getAttribute( '_cke_saved_name' ) || 
+									element.getAttribute( 'name' ) ||
+									'' );
 						},
 						commit : function( element )
 						{
-							if ( this.getValue() || this.isChanged() )
-								element.setAttribute( 'name', this.getValue() );
+							if ( this.getValue() )
+								element.setAttribute( '_cke_saved_name', this.getValue() );
+							else
+							{
+								element.removeAttribute( '_cke_saved_name' );
+								element.removeAttribute( 'name' );
+							}
 						}
 					},
 					{
-						id : 'txtAction',
+						id : 'action',
 						type : 'text',
 						label : editor.lang.form.action,
 						'default' : '',
-						accessKey : 'A',
-						setup : function( element )
-						{
-							this.setValue( element.getAttribute( 'action' ) );
-						},
-						commit : function( element )
-						{
-							if ( this.getValue() || this.isChanged() )
-								element.setAttribute( 'action', this.getValue() );
-						}
+						accessKey : 'A'
 					},
 					{
@@ -80,21 +111,12 @@
 						[
 							{
-								id : 'txtId',
+								id : 'id',
 								type : 'text',
 								label : editor.lang.common.id,
 								'default' : '',
-								accessKey : 'I',
-								setup : function( element )
-								{
-									this.setValue( element.getAttribute( 'id' ) );
-								},
-								commit : function( element )
-								{
-									if ( this.getValue() || this.isChanged() )
-										element.setAttribute( 'id', this.getValue() );
-								}
+								accessKey : 'I'
 							},
 							{
-								id : 'cmbEncoding',
+								id : 'encoding',
 								type : 'select',
 								label : editor.lang.form.encoding,
@@ -108,14 +130,5 @@
 									[ 'multipart/form-data' ],
 									[ 'application/x-www-form-urlencoded' ]
-								],
-								setup : function( element )
-								{
-									this.setValue( element.getAttribute( 'encoding' ) );
-								},
-								commit : function( element )
-								{
-									if ( this.getValue() || this.isChanged() )
-										element.setAttribute( 'encoding', this.getValue() );
-								}
+								]
 							}
 						]
@@ -127,5 +140,5 @@
 						[
 							{
-								id : 'cmbTarget',
+								id : 'target',
 								type : 'select',
 								label : editor.lang.form.target,
@@ -140,17 +153,8 @@
 									[ editor.lang.form.targetSelf, '_self' ],
 									[ editor.lang.form.targetParent, '_parent' ]
-								],
-								setup : function( element )
-								{
-									this.setValue( element.getAttribute( 'target' ) );
-								},
-								commit : function( element )
-								{
-									if ( this.getValue() || this.isChanged() )
-										element.setAttribute( 'target', this.getValue() );
-								}
+								]
 							},
 							{
-								id : 'cmbMethod',
+								id : 'method',
 								type : 'select',
 								label : editor.lang.form.method,
@@ -161,13 +165,5 @@
 									[ 'GET', 'get' ],
 									[ 'POST', 'post' ]
-								],
-								setup : function( element )
-								{
-									this.setValue( element.getAttribute( 'method' ) );
-								},
-								commit : function( element )
-								{
-									element.setAttribute( 'method', this.getValue() );
-								}
+								]
 							}
 						]
Index: /CKEditor/trunk/_source/plugins/forms/dialogs/hiddenfield.js
===================================================================
--- /CKEditor/trunk/_source/plugins/forms/dialogs/hiddenfield.js	(revision 3406)
+++ /CKEditor/trunk/_source/plugins/forms/dialogs/hiddenfield.js	(revision 3407)
@@ -30,8 +30,8 @@
 				element.setAttribute( 'type', 'hidden' );
 			}
-			this.commitContent( element );
-
+			
 			if ( isInsertMode )
 				editor.insertElement( element );
+			this.commitContent( element );
 		},
 		contents : [
@@ -42,5 +42,5 @@
 				elements : [
 					{
-						id : 'txtName',
+						id : '_cke_saved_name',
 						type : 'text',
 						label : editor.lang.hidden.name,
@@ -49,15 +49,22 @@
 						setup : function( element )
 						{
-							this.setValue( element.getAttribute( 'name' ) );
-							this.focus();
+							this.setValue(
+									element.getAttribute( '_cke_saved_name' ) ||
+									element.getAttribute( 'name' ) ||
+									'' );
 						},
 						commit : function( element )
 						{
-							if ( this.getValue() || this.isChanged() )
-								element.setAttribute( 'name', this.getValue() );
+							if ( this.getValue() )
+								element.setAttribute( '_cke_saved_name', this.getValue() );
+							else
+							{
+								element.removeAttribute( '_cke_saved_name' );
+								element.removeAttribute( 'name' );
+							}
 						}
 					},
 					{
-						id : 'txtValue',
+						id : 'value',
 						type : 'text',
 						label : editor.lang.hidden.value,
@@ -66,10 +73,12 @@
 						setup : function( element )
 						{
-							this.setValue( element.getAttribute( 'value' ) );
+							this.setValue( element.getAttribute( 'value' ) || '' );
 						},
 						commit : function( element )
 						{
-							if ( this.getValue() || this.isChanged() )
+							if ( this.getValue() )
 								element.setAttribute( 'value', this.getValue() );
+							else
+								element.removeAttribute( 'value' );
 						}
 					}
Index: /CKEditor/trunk/_source/plugins/forms/dialogs/radio.js
===================================================================
--- /CKEditor/trunk/_source/plugins/forms/dialogs/radio.js	(revision 3406)
+++ /CKEditor/trunk/_source/plugins/forms/dialogs/radio.js	(revision 3407)
@@ -30,8 +30,8 @@
 				element.setAttribute( 'type', 'radio' );
 			}
-			this.commitContent( element );
 
 			if ( isInsertMode )
 				editor.insertElement( element );
+			this.commitContent( { element : element } );
 		},
 		contents : [
@@ -42,5 +42,5 @@
 				elements : [
 					{
-						id : 'txtName',
+						id : 'name',
 						type : 'text',
 						label : editor.lang.common.name,
@@ -49,15 +49,21 @@
 						setup : function( element )
 						{
-							this.setValue( element.getAttribute( 'name' ) );
-							this.focus();
+							this.setValue( element.getAttribute( '_cke_saved_name' ) || '' );
 						},
-						commit : function( element )
+						commit : function( data )
 						{
-							if ( this.getValue() || this.isChanged() )
-								element.setAttribute( 'name', this.getValue() );
+							var element = data.element;
+
+							if ( this.getValue() )
+								element.setAttribute( '_cke_saved_name', this.getValue() );
+							else
+							{
+								element.removeAttribute( '_cke_saved_name' );
+								element.removeAttribute( 'name' );
+							}
 						}
 					},
 					{
-						id : 'txtValue',
+						id : 'value',
 						type : 'text',
 						label : editor.lang.checkboxAndRadio.value,
@@ -66,14 +72,18 @@
 						setup : function( element )
 						{
-							this.setValue( element.getAttribute( 'value' ) );
+							this.setValue( element.getAttribute( 'value' ) || '' );
 						},
-						commit : function( element )
+						commit : function( data )
 						{
-							if ( this.getValue() || this.isChanged() )
+							var element = data.element;
+
+							if ( this.getValue() )
 								element.setAttribute( 'value', this.getValue() );
+							else
+								element.removeAttribute( 'value' );
 						}
 					},
 					{
-						id : 'cmbSelected',
+						id : 'checked',
 						type : 'checkbox',
 						label : editor.lang.checkboxAndRadio.selected,
@@ -85,8 +95,31 @@
 							this.setValue( element.getAttribute( 'checked' ) );
 						},
-						commit : function( element )
+						commit : function( data )
 						{
-							if ( this.getValue() || this.isChanged() )
-								element.setAttribute( 'checked', this.getValue() );
+							var element = data.element;
+
+							if ( !CKEDITOR.env.ie )
+							{
+								if ( this.getValue() )
+									element.setAttribute( 'checked', 'checked' );
+								else
+									element.removeAttribute( 'checked' );
+							}
+							else
+							{
+								var isElementChecked = element.getAttribute( 'checked' );
+								var isChecked = !!this.getValue();
+
+								if ( isElementChecked != isChecked )
+								{
+									var replace = CKEDITOR.dom.element.createFromHtml( '<input type="radio"'
+											+ ( isChecked ? ' checked="checked"' : '' )
+											+ '></input>', editor.document );
+									element.copyAttributes( replace, { type : 1, checked : 1 } );
+									replace.replace( element );
+									editor.getSelection().selectElement( replace );
+									data.element = replace;
+								}
+							}
 						}
 					}
Index: /CKEditor/trunk/_source/plugins/forms/dialogs/select.js
===================================================================
--- /CKEditor/trunk/_source/plugins/forms/dialogs/select.js	(revision 3406)
+++ /CKEditor/trunk/_source/plugins/forms/dialogs/select.js	(revision 3407)
@@ -133,5 +133,5 @@
 		title : editor.lang.select.title,
 		minWidth : 375,
-		minHeight : 270,
+		minHeight : 290,
 		onShow : function()
 		{
@@ -143,5 +143,5 @@
 				this.setupContent( element.getName(), element );
 
-				//Load Options into dialog.
+				// Load Options into dialog.
 				var objOptions = getOptions( element );
 				for ( var i = 0 ; i < objOptions.count() ; i++ )
@@ -181,14 +181,18 @@
 						setup : function( name, element )
 						{
-							if ( name == 'select' )
-							{
-								this.setValue( element.getAttribute( 'name' ) );
-								this.focus();
-							}
+							if ( name == 'clear' )
+								this.setValue( '' );
+							else if ( name == 'select' )
+								this.setValue( element.getAttribute( '_cke_saved_name' ) || '' );
 						},
 						commit : function( element )
 						{
-							if ( this.getValue() || this.isChanged() )
-								element.setAttribute( 'name', this.getValue() );
+							if ( this.getValue() )
+								element.setAttribute( '_cke_saved_name', this.getValue() );
+							else
+							{
+								element.removeAttribute( '_cke_saved_name' ) ;
+								element.removeAttribute( 'name' );
+							}
 						}
 					},
@@ -201,6 +205,15 @@
 						style : 'width:350px',
 						'default' : '',
-						readonly : true,		// TODO: make it readonly somehow.
-						disabled : true
+						onLoad : function()
+						{
+							this.getInputElement().setAttribute( 'readOnly', true );
+						},
+						setup : function( name, element )
+						{
+							if ( name == 'clear' )
+								this.setValue( '' );
+							else if ( name == 'option' && element.getAttribute( 'selected' ) )
+								this.setValue( element.$.value );
+						}
 					},
 					{
@@ -227,10 +240,12 @@
 								{
 									if ( name == 'select' )
-										this.setValue( element.getAttribute( 'size' ) );
+										this.setValue( element.getAttribute( 'size' ) || '' );
 								},
 								commit : function( element )
 								{
-									if ( this.getValue() || this.isChanged() )
+									if ( this.getValue() )
 										element.setAttribute( 'size', this.getValue() );
+									else
+										element.removeAttribute( 'size' );
 								}
 							},
@@ -505,6 +520,8 @@
 								commit : function( element )
 								{
-									if ( this.getValue() || this.isChanged() )
+									if ( this.getValue() )
 										element.setAttribute( 'multiple', this.getValue() );
+									else
+										element.removeAttribute( 'multiple' );
 								}
 							}
Index: /CKEditor/trunk/_source/plugins/forms/dialogs/textarea.js
===================================================================
--- /CKEditor/trunk/_source/plugins/forms/dialogs/textarea.js	(revision 3406)
+++ /CKEditor/trunk/_source/plugins/forms/dialogs/textarea.js	(revision 3407)
@@ -41,5 +41,5 @@
 				elements : [
 					{
-						id : 'txtName',
+						id : '_cke_saved_name',
 						type : 'text',
 						label : editor.lang.common.name,
@@ -48,15 +48,19 @@
 						setup : function( element )
 						{
-							this.setValue( element.getAttribute( 'name' ) );
-							this.focus();
+							this.setValue( element.getAttribute( '_cke_saved_name' ) );
 						},
 						commit : function( element )
 						{
-							if ( this.getValue() || this.isChanged() )
-								element.setAttribute( 'name', this.getValue() );
+							if ( this.getValue() )
+								element.setAttribute( '_cke_saved_name', this.getValue() );
+							else
+							{
+								element.removeAttribute( '_cke_saved_name' );
+								element.removeAttribute( 'name' );
+							}
 						}
 					},
 					{
-						id : 'txtColumns',
+						id : 'cols',
 						type : 'text',
 						label : editor.lang.textarea.cols,
@@ -64,21 +68,21 @@
 						accessKey : 'C',
 						style : 'width:50px',
-						validate: function()
-						{
-							var func = CKEDITOR.dialog.validate.integer( editor.lang.common.validateNumberFailed );
-							return func.apply( this );
-						},
+						validate : CKEDITOR.dialog.validate.integer( editor.lang.common.validateNumberFailed ),
 						setup : function( element )
 						{
-							this.setValue( element.getAttribute( 'cols' ) );
+							var ieDefault = 20;
+							var value = element.getAttribute( 'cols' );
+							this.setValue( ( CKEDITOR.env.ie && ( value == ieDefault ) ? '' : value ) || '' );
 						},
 						commit : function( element )
 						{
-							if ( this.getValue() || this.isChanged() )
+							if ( this.getValue() )
 								element.setAttribute( 'cols', this.getValue() );
+							else
+								element.removeAttribute( 'cols' );
 						}
 					},
 					{
-						id : 'txtRows',
+						id : 'rows',
 						type : 'text',
 						label : editor.lang.textarea.rows,
@@ -86,17 +90,17 @@
 						accessKey : 'R',
 						style : 'width:50px',
-						validate: function()
-						{
-							var func = CKEDITOR.dialog.validate.integer( editor.lang.common.validateNumberFailed );
-							return func.apply( this );
-						},
+						validate : CKEDITOR.dialog.validate.integer( editor.lang.common.validateNumberFailed ),
 						setup : function( element )
 						{
-							this.setValue( element.getAttribute( 'rows' ) );
+							var ieDefault = 2;
+							var value = element.getAttribute( 'rows' );
+							this.setValue( ( CKEDITOR.env.ie && ( value == ieDefault ) ? '' : value ) || '' );
 						},
 						commit : function( element )
 						{
-							if ( this.getValue() || this.isChanged() )
+							if ( this.getValue() )
 								element.setAttribute( 'rows', this.getValue() );
+							else
+								element.removeAttribute( 'rows' );
 						}
 					}
Index: /CKEditor/trunk/_source/plugins/forms/dialogs/textfield.js
===================================================================
--- /CKEditor/trunk/_source/plugins/forms/dialogs/textfield.js	(revision 3406)
+++ /CKEditor/trunk/_source/plugins/forms/dialogs/textfield.js	(revision 3407)
@@ -5,4 +5,23 @@
 CKEDITOR.dialog.add( 'textfield', function( editor )
 {
+	var autoAttributes =
+	{
+		value : 1,
+		size : 1,
+		maxLength : 1
+	};
+
+	var ieDefaults =
+	{
+		size : 20,
+		maxLength : 0x7fffffff
+	};
+
+	var acceptedTypes =
+	{
+		text : 1,
+		password : 1
+	};
+
 	return {
 		title : editor.lang.textfield.title,
@@ -12,5 +31,6 @@
 		{
 			var element = this.getParentEditor().getSelection().getSelectedElement();
-			if ( element && element.getName() == "input" && ( element.getAttribute( 'type' ) == "text" || !element.getAttribute( 'type' ) ) )
+			if ( element && element.getName() == "input" &&
+					( acceptedTypes[ element.getAttribute( 'type' ) ] || !element.getAttribute( 'type' ) ) )
 			{
 				this._element = element;
@@ -30,8 +50,39 @@
 				element.setAttribute( 'type', 'text' );
 			}
-			this.commitContent( element );
 
 			if ( isInsertMode )
 				editor.insertElement( element );
+			this.commitContent( { element : element } );
+		},
+		onLoad : function()
+		{
+			var autoSetup = function( element )
+			{
+				var value = element.getAttribute( this.id );
+				if ( CKEDITOR.env.ie && ( this.id in ieDefaults ) && ieDefaults[ this.id ] == value )
+					this.setValue( '' );
+				else
+					this.setValue( element.getAttribute( this.id ) || '' );
+			};
+
+			var autoCommit = function( data )
+			{
+				var element = data.element;
+				var value = this.getValue();
+
+				if ( value )
+					element.setAttribute( this.id, value );
+				else
+					element.removeAttribute( this.id );
+			};
+
+			this.foreach( function( contentObj )
+				{
+					if ( autoAttributes[ contentObj.id ] )
+					{
+						contentObj.setup = autoSetup;
+						contentObj.commit = autoCommit;
+					}
+				} );
 		},
 		contents : [
@@ -47,5 +98,5 @@
 						[
 							{
-								id : 'txtName',
+								id : '_cke_saved_name',
 								type : 'text',
 								label : editor.lang.textfield.name,
@@ -54,28 +105,28 @@
 								setup : function( element )
 								{
-									this.setValue( element.getAttribute( 'name' ) );
-									this.focus();
+									this.setValue( 
+											element.getAttribute( '_cke_saved_name' ) ||
+											element.getAttribute( 'name' ) ||
+											'' );
 								},
-								commit : function( element )
+								commit : function( data )
 								{
-									if ( this.getValue() || this.isChanged() )
-										element.setAttribute( 'name', this.getValue() );
+									var element = data.element;
+
+									if ( this.getValue() )
+										element.setAttribute( '_cke_saved_name', this.getValue() );
+									else
+									{
+										element.removeAttribute( '_cke_saved_name' );
+										element.removeAttribute( 'name' );
+									}
 								}
 							},
 							{
-								id : 'txtValue',
+								id : 'value',
 								type : 'text',
 								label : editor.lang.textfield.value,
 								'default' : '',
-								accessKey : 'V',
-								setup : function( element )
-								{
-									this.setValue( element.getAttribute( 'value' ) );
-								},
-								commit : function( element )
-								{
-									if ( this.getValue() || this.isChanged() )
-										element.setAttribute( 'value', this.getValue() );
-								}
+								accessKey : 'V'
 							}
 						]
@@ -87,5 +138,5 @@
 						[
 							{
-								id : 'txtTextCharWidth',
+								id : 'size',
 								type : 'text',
 								label : editor.lang.textfield.charWidth,
@@ -93,21 +144,8 @@
 								accessKey : 'C',
 								style : 'width:50px',
-								validate: function()
-								{
-									var func = CKEDITOR.dialog.validate.integer( editor.lang.common.validateNumberFailed );
-									return func.apply( this );
-								},
-								setup : function( element )
-								{
-									this.setValue( element.getAttribute( 'size' ) );
-								},
-								commit : function( element )
-								{
-									if ( this.getValue() || this.isChanged() )
-										element.setAttribute( 'size', this.getValue() );
-								}
+								validate : CKEDITOR.dialog.validate.integer( editor.lang.common.validateNumberFailed )
 							},
 							{
-								id : 'txtMaxChars',
+								id : 'maxLength',
 								type : 'text',
 								label : editor.lang.textfield.maxChars,
@@ -115,23 +153,10 @@
 								accessKey : 'M',
 								style : 'width:50px',
-								validate: function()
-								{
-									var func = CKEDITOR.dialog.validate.integer( editor.lang.common.validateNumberFailed );
-									return func.apply( this );
-								},
-								setup : function( element )
-								{
-									this.setValue( element.getAttribute( 'maxlength' ) );
-								},
-								commit : function( element )
-								{
-									if ( this.getValue() || this.isChanged() )
-										element.setAttribute( 'maxlength', this.getValue() );
-								}
+								validate : CKEDITOR.dialog.validate.integer( editor.lang.common.validateNumberFailed )
 							}
 						]
 					},
 					{
-						id : 'cmbType',
+						id : 'type',
 						type : 'select',
 						label : editor.lang.textfield.type,
@@ -141,5 +166,5 @@
 						[
 							[ editor.lang.textfield.typeText, 'text' ],
-							[ editor.lang.textfield.typePass, 'pass' ]
+							[ editor.lang.textfield.typePass, 'password' ]
 						],
 						setup : function( element )
@@ -147,7 +172,24 @@
 							this.setValue( element.getAttribute( 'type' ) );
 						},
-						commit : function( element )
+						commit : function( data )
 						{
-							element.setAttribute( 'type', this.getValue() );
+							var element = data.element;
+
+							if ( CKEDITOR.env.ie )
+							{
+								var elementType = element.getAttribute( 'type' );
+								var myType = this.getValue();
+
+								if ( elementType != myType )
+								{
+									var replace = CKEDITOR.dom.element.createFromHtml( '<input type="' + myType + '"></input>', editor.document );
+									element.copyAttributes( replace, { type : 1 } );
+									replace.replace( element );
+									editor.getSelection().selectElement( replace );
+									data.element = element;
+								}
+							}
+							else
+								element.setAttribute( 'type', this.getValue() );
 						}
 					}
Index: /CKEditor/trunk/_source/plugins/htmldataprocessor/plugin.js
===================================================================
--- /CKEditor/trunk/_source/plugins/htmldataprocessor/plugin.js	(revision 3406)
+++ /CKEditor/trunk/_source/plugins/htmldataprocessor/plugin.js	(revision 3407)
@@ -71,4 +71,15 @@
 					if ( attribs._cke_saved_href )
 						delete attribs.href;
+				},
+				
+				/**
+				 * IE sucks with dynamic 'name' attribute after element is created, '_cke_saved_name' is used instead for this attribute.    
+				 */				
+				input : function( element )
+				{
+					var attribs = element.attributes;
+
+					if ( attribs._cke_saved_name )
+						delete attribs.name;
 				}
 			},
@@ -94,9 +105,9 @@
 	}
 
-	var protectUrlTagRegex = /<(?:a|area|img).*?\s((?:href|src)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+)))/gi;
-
-	function protectUrls( html )
+	var protectAttributeRegex = /<(?:a|area|img|input).*?\s((?:href|src|name)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+)))/gi;
+	
+	function protectAttributes( html )
 	{
-		return html.replace( protectUrlTagRegex, '$& _cke_saved_$1' );
+		return html.replace( protectAttributeRegex, '$& _cke_saved_$1' );
 	}
 
@@ -133,5 +144,5 @@
 			// browser may changing them when setting the innerHTML later in
 			// the code.
-			data = protectUrls( data );
+			data = protectAttributes( data );
 
 			// Call the browser to help us fixing a possibly invalid HTML
