PDA

View Full Version : Issue with HTMLEditor in IE9



nitsko
13 Nov 2012, 8:59 AM
Hello,

I'm trying to use HTMLEditor within multipart/form-data form:

<script>
function doSubmit() {
var editor = myEditor.down('#displayName');
var sName = editor.getValue();
var myForm = document.getElementById('myform');
myForm.sDisplayName.value = sName;
myForm.submit();
}
var myEditor;
Ext.onReady(function() {
myEditor = Ext.create("Ext.panel.Panel", {

height: 100,
width: 552,
renderTo: 'richtext',
items:[{


xtype: 'htmleditor',
itemId: 'displayName',
name: 'displayName',
fontFamilies: [...],
height: 100,
width: 550,
border: 0,
value: ...,

}]
});
myEditor.down('#displayName').focus();
myEditor.show();
});
</script>
<form name="myform" id="myform" action="..." .method="post" enctype="multipart/form-data">
...
...
<div id="richtext"></div>
</form>

The form also contains 'OK' button that calls to doSubmit() on click, and hidden input parameter sDisplayName along with couple of others input fields and a file input. Here is the problem: generated textarea element has empty name attribute. Chrome and Firefox just omit it while generating POST request, which I am fine with, but IE includes value of the generated textarea element in the request. Since the textarea input name is blank, the param name is also empty, which causes troubles when the request is processed by another JSP. This how it looks in the IE network sniffer:

Content-Disposition: form-data; name=""

<FONT style="FONT-FAMILY: Arial; FONT-SIZE: 36px">My Text</FONT>

This is considered an invalid request, and request processing fails (as it should)

Why the textarea element is generated with blank name? I would expect the name config be used as the HTML name attribute. Does anybody know a workaroud, like preventing IE from submitting textarea input? I've tried to set submitValue config to false, also tried to set disabled config to true before submitting - no success.

nitsko
14 Nov 2012, 6:42 AM
I opened a ticket - HTMLEditor is broken in 4.1.3
http://www.sencha.com/forum/showthread.php?248949-HTMLEditor-producing-textarea-HML-element-with-empty-name