Editable IFRAME

T

toddaa

I have an editable Iframe control that I am using to allow users to
input formated text into a database for later viewing. One feature I
am toying with is the ability to vertically align their text. The idea
is to have a button for TOP, MIDDLE, and BOTTOM in which each will move
the text to the desired location within the box. So far I have tried
two ways to accomplish this. One is with a DIV around the text and
when the button is clicked it moves the DIV based on how high the DIV
has become. The other way I have attempted this is with a TABLE which
covers the entire iframe. When the buttons are clicked the appropriate
location is set in the cells valign property.

With the DIV attempt the body of the iframe has contentEditable turned
off and the DIV turned on. This would restrict the user from typing
outside of the DIV. The problem is that when the user clicks on the
iframe but outside of the DIV the cursor is gone. The user could also
hit ctrl-a on the keyboard to select all and eventually delete the DIV.


With the TABLE attempt the body of the iframe has contentEditable
turned on sice the TABLE seemed to not have that property. With the
body being off the table couldnt be edited. The problem here is that
the user can now type outside of the table and also delete the table
much easer than the DIV.

Both of these are no good. I want to be able to vertically align the
text inside the iframe but I'm running out of ideas on how it might be
possible. Anyone got any input on how this might be accomplished?
Thanks to anyone who can shoot an idea my way.
 
T

toddaa

Thanks to anyone who viewed my post. I'm sure everyone who read it at
least half way through said what the hell is this guy talking about.
But thank you for at least reading that far. I finally solved my own
problem by turning designMode off on the iframe and leaving the
contentEditable property on the div set to true. Doing this, the div
can not be deleted and the cursor doesnt appear to come up missing when
the user clicks outside of the div. Plus I can vertically align the
div by giving setting the top property in its stylesheet.

Thanks again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top