Hi again list,
I'm in need of some editable multi-line field that can display full HTML, is there something around? (I don't need a text editor, just the "editable" part of a text editor, without buttons, image uploading, link creation, etc.)
Thanks! Bernat Romagosa.
|
Le mercredi 23 mars 2011 à 13:26 +0100, AxiNat a écrit :
> (I don't need a text editor, just the "editable" part of a text > editor, without buttons, image uploading, link creation, etc.) I don't understand then. Why not just writing HTML inside a textarea? Cheers, Nico |
Because, instead of rendering the HTML, it displays the HTML code.
What I'd need is something like: h magicTextArea contents: 'I am an <b>HTML</b> capable textarea'
Right now I'm using a tweaked javascript editor, but if there was a more elegant way I'd be happy to know :) Thanks! Bernat Romagosa. 2011/3/23 Nicolas Petton <[hidden email]> Le mercredi 23 mars 2011 à 13:26 +0100, AxiNat a écrit : |
Le mercredi 23 mars 2011 à 13:52 +0100, AxiNat a écrit :
> Because, instead of rendering the HTML, it displays the HTML code. > > > What I'd need is something like: > > > h magicTextArea contents: 'I am an <b>HTML</b> capable textarea' > > > Right now I'm using a tweaked javascript editor, but if there was a > more elegant way I'd be happy to know :) Not that I know of :/ Was Google helpful? Cheers, Nico > > > Thanks! > > > Bernat Romagosa. > > 2011/3/23 Nicolas Petton <[hidden email]> > Le mercredi 23 mars 2011 à 13:26 +0100, AxiNat a écrit : > > (I don't need a text editor, just the "editable" part of a > text > > editor, without buttons, image uploading, link creation, > etc.) > > > I don't understand then. Why not just writing HTML inside a > textarea? > > Cheers, > Nico > > > |
Google was not much helpful... I was hoping HTML5 would implement some new tag that could do the job, but it seems it doesn't.
No problem though, I'll keep working on integrating the javascript one (didn't have much luck with it yesterday).
Thanks! Bernat.
2011/3/24 Nicolas Petton <[hidden email]> Le mercredi 23 mars 2011 à 13:52 +0100, AxiNat a écrit : |
I don't know if I understood correctly but there is a a method in JavaScript which makes an element editable like in rich text editors (or commonly WYSIWYG editors):
document.getElementById('edit').contentDocument.designMode = "on"; Here "edit" might be an iframe for example. I've never used this on my projects so I don't know much about it... https://developer.mozilla.org/en/rich-text_editing_in_mozilla http://www.mozilla.org/editor/midasdemo/ Addition: While I was looking for examples I heard that from Firefox 3 on there is also "contentEditable" attribute for elements to make them editable: http://starkravingfinkle.org/blog/2007/07/firefox-3-contenteditable/ http://starkravingfinkle.org/blog/wp-content/uploads/2007/07/contenteditable.htm Both ways seems to be working on both Firefox and Chrome, I don't know if they work on IE.
Canol Gökel
|
Wow thanks a lot, I'll check it out :)
(My app doesn't offer support for IE, so that shouldn't be a problem) Bernat.
|
Free forum by Nabble | Edit this page |