B
Brent
The code below correctly sets an iframe to be editable, and then tries
to attach an "onkeyup" event to the iframe. Instead of doing that,
however, it generates a cryptic "Object required" error in Explorer 7,
and doesn't seem to do anything at all in Firefox. Am I missing
something really basic?
Thanks for any help.
--Brent
--------------------------------------------------------------------------
function makeEditable(el)
{
thisEl = el.contentWindow.document;
try
{
if(thisEl.body.contentEditable)
{thisEl.body.contentEditable = true;}
else
{thisEl.designMode = "on";}
}
catch(e)
{
alert(e);
}
thisEl.body.style.fontFamily = "verdana, arial, helvetica, sans-
serif";
thisEl.body.style.fontSize = "12px";
thisEl.body.style.margin = "1px";
thisEl.onkeyup = checkKeys; //<--doesn't seem to register the
event
}
function checkKeys(e)
{
var event = e ? e : window.event;
var KeyID = event.keyCode;
alert(KeyID);
}
to attach an "onkeyup" event to the iframe. Instead of doing that,
however, it generates a cryptic "Object required" error in Explorer 7,
and doesn't seem to do anything at all in Firefox. Am I missing
something really basic?
Thanks for any help.
--Brent
--------------------------------------------------------------------------
function makeEditable(el)
{
thisEl = el.contentWindow.document;
try
{
if(thisEl.body.contentEditable)
{thisEl.body.contentEditable = true;}
else
{thisEl.designMode = "on";}
}
catch(e)
{
alert(e);
}
thisEl.body.style.fontFamily = "verdana, arial, helvetica, sans-
serif";
thisEl.body.style.fontSize = "12px";
thisEl.body.style.margin = "1px";
thisEl.onkeyup = checkKeys; //<--doesn't seem to register the
event
}
function checkKeys(e)
{
var event = e ? e : window.event;
var KeyID = event.keyCode;
alert(KeyID);
}