This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes HTML, CSS and JavaScript and the fly likes IFrame Editor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "IFrame Editor" Watch "IFrame Editor" New topic

IFrame Editor

Animesh Saxena
Ranch Hand

Joined: Jan 15, 2006
Posts: 62
I have a simple IFrame editor which has a couple of span tags like

<SPAN class="custombold"> Some Content </SPAN>

<SPAN class="custombold"> Some Other Content </SPAN>

<SPAN class="custombold"> Some Other New Content </SPAN>

When this content is rendered in text form and I try to add new content at the end of span tag it is put inside the SPAN Tag. For example if I go to the end of this line "Some other Content" and press enter for adding new content then this content is added inside the SPAN tag (Second span tag). What I want is that content should come outside span tags. Since we are using span tags for applying styles we can't have user pressing enter to type in some new content and it automatically gets linked with the previous one. It's like user making some text bold and pressing enter and again the new text he types is in Bold. I know the ISSUE is with IFRAME editor, it automatically places the content inside the existing span tag. Is there any work around?

Any ideaz?

Animesh Saxena<br /> <br />Open Source Developer
Animesh Saxena
Ranch Hand

Joined: Jan 15, 2006
Posts: 62
It's a problem when IE renders tags. I was using anchor tag with contentEditable = false property. When I tried using contentEditable = inherit the SPAN tags were coming correctly. So the lame piece of code is

onkeydown --- change all contentEditable properties to inherit

onkeyup --- change it back to false.

Consider Paul's rocket mass heater.
subject: IFrame Editor