Index: /FCKeditor.Java/trunk/java-core/src/main/java/net/fckeditor/FCKeditor.java
===================================================================
--- /FCKeditor.Java/trunk/java-core/src/main/java/net/fckeditor/FCKeditor.java	(revision 4597)
+++ /FCKeditor.Java/trunk/java-core/src/main/java/net/fckeditor/FCKeditor.java	(revision 4598)
@@ -34,6 +34,6 @@
  * The final output of this class is HTML code.<br />
  * <strong>Note:</strong> It's your responsibility to supply reasonable and
- * valid values, only {@code request} and {@code instanceName} will be checked
- * for sanity.
+ * valid values, only {@code request}, {@code instanceName} and {@code inputName}
+ * will be checked for sanity.
  * 
  * @version $Id$
@@ -43,4 +43,5 @@
 	private FCKeditorConfig fckConfig = new FCKeditorConfig();
 	private String instanceName;
+	private String inputName;
 	private HttpServletRequest request;
 
@@ -53,9 +54,42 @@
 
 	/**
-	 * Class constructor with all basic parameters.
-	 * 
-	 * A constructors which handles basic FCKeditor initialization with a few
-	 * parameters. If you omit basic parameters, default ones will be taken from
-	 * the {@link PropertiesLoader properties file}.
+	 * Class constructor with all parameters.
+	 * 
+	 * @param request
+	 *            current user request instance
+	 * @param instanceName
+	 *            the unique name of this editor
+	 * @param inputName
+	 *            the name for the underlying input element. See
+	 *            {@link #setInputName(String)} for details.
+	 * @param width
+	 *            the desired editor width (CSS-style value)
+	 * @param height
+	 *            the desired editor height (CSS-style value)
+	 * @param toolbarSet
+	 *            the desired toolbar set name
+	 * @param value
+	 *            the HTML markup of this editor. Markup will be properly
+	 *            escaped.
+	 * @param basePath
+	 *            the base path of this editor, absolute to the context
+	 * @throws IllegalArgumentException
+	 *             if instanceName is empty or not a valid XHTML id
+	 */
+	public FCKeditor(HttpServletRequest request, String instanceName,
+			String inputName, String width, String height, String toolbarSet,
+			String value, String basePath) {
+		
+		this(request, instanceName, inputName);
+		this.width = width;
+		this.height = height;
+		this.toolbarSet = toolbarSet;
+		this.value = value;
+		this.basePath = basePath;
+		
+	}
+
+	/**
+	 * Class constructor with a extended set of parameters.
 	 * 
 	 * @param request
@@ -81,10 +115,6 @@
 			final String toolbarSet, final String value, final String basePath) {
 
-		this(request, instanceName);
-		this.width = width;
-		this.height = height;
-		this.toolbarSet = toolbarSet;
-		this.value = value;
-		this.basePath = basePath;
+		this(request, instanceName, null, width, height, toolbarSet, value,
+				basePath);
 
 	}
@@ -110,4 +140,25 @@
 		setInstanceName(instanceName);
 
+	}
+
+	/**
+	 * Class constructor with a basic set of parameters.
+	 * 
+	 * Omitted parameters will be set to default values.
+	 * 
+	 * @param request
+	 *            current user request instance
+	 * @param instanceName
+	 *            the unique name of this editor
+	 * @param inputName
+	 *            the name for the underlying input element. See
+	 *            {@link #setInputName(String)} for details.
+	 * @throws IllegalArgumentException
+	 *             if instanceName is empty or not a valid HTML id
+	 */
+	public FCKeditor(HttpServletRequest request, String instanceName,
+			String inputName) {
+		this(request, instanceName);
+		setInputName(inputName);
 	}
 
@@ -128,4 +179,18 @@
 		this.instanceName = instanceName;
 	}
+	
+	/**
+	 * Sets the name for the underlying input element. Empty strings will be
+	 * ignored and field will be reset to {@code instanceName}.
+	 * 
+	 * @param inputName
+	 *            the name for the underlying input element
+	 */
+	public void setInputName(final String inputName) {
+		if (Utils.isEmpty(inputName))
+			this.inputName = instanceName;
+		else
+			this.inputName = inputName;
+	}
 
 	/**
@@ -272,7 +337,13 @@
 		strEditor.append("<div>");
 		String encodedValue = escapeXml(value);
+		
+		/*
+		 * We have to reset inputName to make sure that a potentially reassigned
+		 * instanceName has been propagated to empty field.
+		 */
+		setInputName(inputName);
 
 		if (Compatibility.isCompatibleBrowser(request)) {
-			strEditor.append(createInputForVariable(instanceName, instanceName,
+			strEditor.append(createInputForVariable(instanceName, inputName,
 					encodedValue));
 
@@ -280,6 +351,6 @@
 			String configStr = fckConfig.getUrlParams();
 			if (Utils.isNotEmpty(configStr))
-				strEditor.append(createInputForVariable(null, instanceName
-						.concat("___Config"), configStr));
+				strEditor.append(createInputForVariable(instanceName
+						.concat("___Config"), null, configStr));
 
 			// create IFrame
@@ -304,5 +375,5 @@
 			XHtmlTagTool textareaTag = new XHtmlTagTool("textarea",
 					encodedValue);
-			textareaTag.addAttribute("name", instanceName);
+			textareaTag.addAttribute("name", inputName);
 			textareaTag.addAttribute("rows", "4");
 			textareaTag.addAttribute("cols", "40");
@@ -327,20 +398,18 @@
 	/**
 	 * Creates a hidden input element for the given attributes.
-	 * 
+	 * @param id
+	 *            id attribute of the input tag
 	 * @param name
 	 *            name attribute of the input tag
-	 * @param id
-	 *            id attribute of the input tag
 	 * @param value
 	 *            value attribute of the input tag
+	 * 
 	 * @return the produced XHTML tag
 	 */
-	private String createInputForVariable(final String name, final String id,
+	private String createInputForVariable(final String id, final String name,
 			final String value) {
 		XHtmlTagTool tag = new XHtmlTagTool("input");
-		if (Utils.isNotEmpty(id))
-			tag.addAttribute("id", id);
-		if (Utils.isNotEmpty(name))
-			tag.addAttribute("name", name);
+		tag.addAttribute("id", id);
+		tag.addAttribute("name", name);
 		tag.addAttribute("value", value);
 		tag.addAttribute("type", "hidden");
Index: /FCKeditor.Java/trunk/java-core/src/main/java/net/fckeditor/tags/EditorTag.java
===================================================================
--- /FCKeditor.Java/trunk/java-core/src/main/java/net/fckeditor/tags/EditorTag.java	(revision 4597)
+++ /FCKeditor.Java/trunk/java-core/src/main/java/net/fckeditor/tags/EditorTag.java	(revision 4598)
@@ -22,5 +22,4 @@
 
 import java.io.IOException;
-import java.util.Map;
 
 import javax.servlet.http.HttpServletRequest;
@@ -43,4 +42,5 @@
 
 	private String instanceName;
+	private String inputName;
 	private String width;
 	private String height;
@@ -57,4 +57,11 @@
 	public void setInstanceName(String instanceName) {
 		this.instanceName = instanceName;
+	}
+	
+	/**
+	 * @see FCKeditor#setInputName(String) 
+	 */
+	public void setInputName(String inputName) {
+		this.inputName = inputName;
 	}
 
@@ -106,5 +113,5 @@
 		try {
 			fckEditor = new FCKeditor((HttpServletRequest) pageContext
-					.getRequest(), instanceName);
+					.getRequest(), instanceName, inputName);
 
 			if (Utils.isNotEmpty(width))
Index: /FCKeditor.Java/trunk/java-core/src/main/resources/META-INF/FCKeditor.tld
===================================================================
--- /FCKeditor.Java/trunk/java-core/src/main/resources/META-INF/FCKeditor.tld	(revision 4597)
+++ /FCKeditor.Java/trunk/java-core/src/main/resources/META-INF/FCKeditor.tld	(revision 4598)
@@ -52,4 +52,13 @@
 			<name>instanceName</name>
 			<required>true</required>
+			<rtexprvalue>true</rtexprvalue>
+			<type>java.lang.String</type>
+		</attribute>
+		<attribute>
+			<description>
+				The name of the underlying input element. If not passed, field
+				will be reset to instanceName.
+			</description>
+			<name>inputName</name>
 			<rtexprvalue>true</rtexprvalue>
 			<type>java.lang.String</type>
