Results 1 to 2 of 2
Oct 27, 2011, 07:38 #1
- Join Date
- Aug 2010
- 0 Post(s)
- 0 Thread(s)
updating div with text from ckeditor - getting styles to work
I'm fairly new to JS so sorry in advance if this is a stupid question!
I have a textarea which uses ckeditor to make it a wysiwyg. I also have a bit of JS which watches the ckeditor and when a user types into it, whatever they type appears in a div elsewhere on the page.
My ckeditor allows the text to be bold, italic, underlined and resized. When I apply styles to the text in the ckeditor textarea, I want them to reflected in the div which updates. At the moment only underline and resizing the text works. Choosing bold or italic does nothing the text updates ok, but no bold or italic.
I've been told: "Ckeditor is using strong for bold, em for italics. My guess is that the browser or framework you are using doesn't apply bold and italics styles to those tags. You'll have to do that yourself."
I've tested on several browsers, I checked in FF Opera Safari Chrome IE8 & IE9 and its the same in all them. Underline works, resize works but neither bold or italic do. (Interestingly in IE7 bold and italic do work as well as the size and underline! What's going on with that?!?)
So I assume it is the framework? Can anyone tell me if this is right and if so, how do I go about doing that myself?
heres the JS I'm using to update the div:
Oct 28, 2011, 21:18 #2
- Join Date
- Mar 2009
- Melbourne, AU
- 462 Post(s)
- 8 Thread(s)
Do the bold/italic tags appear in the HTML of the rendered page (check View Source)? Or the <strong> and <em> tags? If so, perhaps their default styles are removed in your style sheet.