Discussion:
iframe and showModalDialog
(too old to reply)
VV
2005-01-11 13:58:17 UTC
Permalink
I have problem editing iframe in modal dialog. When executing test2.htm
everything works fine, but when I open the same test2 in dialog editing is
disabled?! Any suggestions?


Example:

Test1.htm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<a href="" onclick="window.showModalDialog('test2.htm', window,
'');">Click</a>
</body>
</html>

Test2.htm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<iframe name="iFra" id="iFra" height="100%" width="100%"
frameborder="1"></iframe>
<script language="javascript">
iFra.document.designMode = 'On';
iFra.document.contentEditable = 'True';
</script>
</body>
</html>
Lithium
2005-01-11 19:23:07 UTC
Permalink
Post by VV
I have problem editing iframe in modal dialog. When executing test2.htm
everything works fine, but when I open the same test2 in dialog editing is
disabled?! Any suggestions?
The showModalDialog ....-.. showModelessDialog methods are useful for menu
options or Help systems. Windows generated with these methods aren'T
selectable ,-editable (only textboxes ->textarea ,input type="text");

if you look at some of your windows applications and click on menu options
you will see that there is nothing editable or selectable and for that you
can use these methods. So noway to turn design mode on.

don't know why you want to use showmodaldialog for this window but if it is
to get the window always on the top you can do a workaround by building your
own window

for example a table with two cells the first cell is the title cell and the
second contains an iframe. you can make the table moveable or hiding by mouse
(clicking on the title cell) with DHTML , not really difficult. to get it
always on top use the zIndex.
VV
2005-01-12 09:23:20 UTC
Permalink
Post by Lithium
The showModalDialog ....-.. showModelessDialog methods are useful for menu
options or Help systems. Windows generated with these methods aren'T
selectable ,-editable (only textboxes ->textarea ,input type="text");
if you look at some of your windows applications and click on menu options
you will see that there is nothing editable or selectable and for that you
can use these methods. So noway to turn design mode on.
don't know why you want to use showmodaldialog for this window but if it is
to get the window always on the top you can do a workaround by building your
own window
for example a table with two cells the first cell is the title cell and the
second contains an iframe. you can make the table moveable or hiding by mouse
(clicking on the title cell) with DHTML , not really difficult. to get it
always on top use the zIndex.
Thanx, my problem was that I want a WYSWYG editor placed in dialog, since
this is not possible :(( The only answer to that is window.open instead of
showModalDialog, or to use textbox...
VV
2005-01-12 11:46:32 UTC
Permalink
Post by VV
Thanx, my problem was that I want a WYSWYG editor placed in dialog, since
this is not possible :(( The only answer to that is window.open instead of
showModalDialog, or to use textbox...
or use div tag instead of iframe

Loading...