elrte on input/textarea elements (IE)
Added by Red Rosky 10 months ago
Hello, I have problems getting elrte editor to work properly on input or textarea elements. On IE when i bind the editor to a empty input type="text"
or to a empty textarea it gets "Object expected" error elrte.full.js Line:6536. From what I read on the forum http://elrte.org/redmine/issues/229
the textarea issue has ben fixed, but that dosent seem to be the case. Is there any way around this issue besides using other elements than input/textarea or adding <p></p> inside the textarea?
Replies (7)
RE: elrte on input/textarea elements (IE)
-
Added by Troex Nevelin 10 months ago
This was fixed in 1.2, but in 1.3 this problem returned. Actually fixing this problem rises another problem that textarea will never be empty, e.g. you haven't changed the empty field, but elRTE added some content.
There is no solution right now, another strange is that the line you mentioned 6536 is image dialog... So it don't looks like empty editor problem.
RE: elrte on input/textarea elements (IE)
-
Added by Red Rosky 10 months ago
Yes, it seems that the empty editor issue is closely related to the image button/dialog(if you remove the image button from the toolbar everything works well - i used tiny toolbar), im still digging around for a more conclusive reason and i'll get back to you if something pops up.
And also when getting the editor value in IE (only tested without the image button) with $('#Editor').elrte('val') it crashes because of lines:
1491 return this.filter.source2source(this.source.val()).trim();
1493 return this.filter.source($(this.doc.body).html()).trim();
Seems that ie has some issues with the .trim() method at the end of these lines. I just removed them and then it worked well. On line 1491 .trim() is not even needed because "this.source.val()" trims the result.
RE: elrte on input/textarea elements (IE)
-
Added by Troex Nevelin 10 months ago
The real root of problem is that IE cannot perform any actions on empty string, other browsers don't have this issue
RE: elrte on input/textarea elements (IE)
-
Added by Francois de montblanc 10 months ago
Bonjour
je confirme, ie ne supporte pas .trim()
il faut modifier les lignes 1491 et 1493 par
1490 if (this.source.is(':visible')) {
1491 return this.filter.source2source(this.source.val());
1492 } else {
1493 return this.filter.source($(this.doc.body).html());
1494 }
RE: elrte on input/textarea elements (IE)
-
Added by Andrés Mateos 9 months ago
Hi,
should this work? seems trim() works fine in ie like this:
1490 if (this.source.is(':visible')) {
1491 return $.trim(this.filter.source2source(this.source.val()));
1492 } else {
1493 return $.trim(this.filter.source(a(this.doc.body).html()));
1494 }
regards
RE: elrte on input/textarea elements (IE)
-
Added by Troex Nevelin 9 months ago
Maybe using $.trim() is good idea, the problem with IE that is fails on empty text like ""
RE: elrte on input/textarea elements (IE)
-
Added by John Doe 4 months ago
use a div tag instead of textarea, so you can ie pass a full toolbar and every type of content (also without a image)
(1-7/7)