Summary | HTMLArea cannot find the correct TEXTAREA |
Queue | Horde Framework Packages |
Type | Bug |
State | Resolved |
Priority | 2. Medium |
Owners | jan (at) horde (dot) org |
Requester | ctnpublic-horde (at) yahoo (dot) com |
Created | 10/14/2004 (7587 days ago) |
Due | |
Updated | 11/13/2004 (7557 days ago) |
Assigned | 10/14/2004 (7587 days ago) |
Resolved | 11/13/2004 (7557 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | No |
State ⇒ Resolved
the first element with that name to become the HTMLArea. We should
instead fix pages that have ambiguous form field names, like I did in
IMP's compose windows, see
bug 793.would vote for it to be checked in, it solves
bug #692&̙.Thanks.
State ⇒ Assigned
As a side effect this would avoid loading not needed script files.
imp/templates/compose/compose.inc has the <input name="message"> when
spelling is turned on. This breaks HTML compose in IE.
Here's another workaround suggestion: find the exact TEXTAREA with the
ID we want.
cvs diff -u -r HEAD framework/Editor/Editor/htmlarea.php
Index: framework/Editor/Editor/htmlarea.php
===================================================================
RCS file: /repository/framework/Editor/Editor/htmlarea.php,v
retrieving revision 1.21
diff -u -r1.21 htmlarea.php
--- framework/Editor/Editor/htmlarea.php 6 Sep 2004 15:01:28
-0000 1.21
+++ framework/Editor/Editor/htmlarea.php 14 Oct 2004 11:03:51 -0000
@@ -55,7 +55,13 @@
'config.hideSomeButtons(" showhelp "); ';
if (isset($params['id'])) {
- $js .= 'var textareas = [document.getElementById("' .
$params['id'] . '")]; ';
+ $js .= 'var alltextareas =
document.getElementsByTagName("textarea"); ' .
+ 'var textarea = null; ' .
+ 'for (tai = 0; tai < alltextareas.length; tai++) { ' .
+ ' textarea = alltextareas[tai]; ' .
+ ' if (textarea.id == "' . $params['id'] . '")
break; ' .
+ '} ' .
+ 'var textareas = [textarea]; ';
} else {
$js .= 'var textareas =
document.getElementsByTagName("textarea"); ';
}
Assigned to Jan Schneider
State ⇒ Feedback
What elements did have a "message" id resp. name?
State ⇒ Unconfirmed
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ HTMLArea cannot find the correct TEXTAREA
Queue ⇒ Horde Framework Packages
getElementByID() matches either the name or the id attribute. There
are two elements on the compose page with the name "message".
HTMLArea 3.x has an API (HTMLArea.replace(id, config)) to handle this.
Suggest using it as follows:
cvs diff -u -r HEAD framework/Editor/Editor/htmlarea.php
Index: framework/Editor/Editor/htmlarea.php
===================================================================
RCS file: /repository/framework/Editor/Editor/htmlarea.php,v
retrieving revision 1.21
diff -u -r1.21 htmlarea.php
--- framework/Editor/Editor/htmlarea.php 6 Sep 2004 15:01:28
-0000 1.21
+++ framework/Editor/Editor/htmlarea.php 14 Oct 2004 09:23:18 -0000
@@ -54,16 +54,18 @@
'config.debug = false; ' .
'config.hideSomeButtons(" showhelp "); ';
+
if (isset($params['id'])) {
- $js .= 'var textareas = [document.getElementById("' .
$params['id'] . '")]; ';
- } else {
- $js .= 'var textareas =
document.getElementsByTagName("textarea"); ';
- }
- $js .= 'for (var i = textareas.length - 1; i >= 0; i--) { ' .
- 'var editor = new HTMLArea(textareas[i], config); ' .
- $plugins .
- 'editor.generate()}}; ' .
- 'HTMLArea.init();';
+
+ $js .= 'var ta = HTMLArea.getElementById("textarea", "' .
$params['id'] . '"); ' .
+ 'HTMLArea.replace("' . $params['id'] . '", config); ';
+
+ } else {
+ $js .= 'HTMLArea.replaceAll(config); ';
+ }
+
+ $js .= '}; ' .
+ 'HTMLArea.init();';
$notification->push($js, 'javascript');
}