PDA

View Full Version : from multiple text area to popup and back to correct textarea


tcadieux
11-26-2002, 05:58 PM
I am trying to get this to work with the RichText Editor, found at richtext.sourceforge.net. I cannot however, for the life of me get their popup code example, which is terrible (but works) to work with what I want. I want to replace what their Example page has, with multiple TextAreas that each have an edit Button next to it, so that when someone hits Edit, it brings up the popup and when they hit Submit on the Popup, it goes back to the correct TextArea...help, I am a VBScripter, not a Java (er).

my Example page looks like this..
<html>
<head>
<link rel=”STYLESHEET” type=”text/css” href=”rte.css”>


</head>
<body>
<input type=”button” value=”Edit” onClick=”edit()”>
<hr>
<div id=”data” height=”200”>

<FORM name=exampleform>
<P><INPUT size3 value" name=text> <INPUT type=button value" name=text>
</P></FORM>
</div>
<script language=”JavaScript”>
function edit() {
var edit={}
edit.src = data.innerHTML;
edit.styledata=document.styleSheets
var ret;
ret = window.showModalDialog(“popup_editor.html”, edit,” dialogWidth:800px;dialogHeight:600px;help:no;statu s:no;scroll:no;resizable:yes;”) data.innerHTML = ret;
}
</script>
</body>
</html>

and my Popup looks like this..

<HTML>
<HEAD>
<META content=”HTML 4.0” name=”vs_targetSchema”>
<META content=”Microsoft Visual Studio 7.0” name=”GENERATOR”>
<title>Edit Text</title>
</HEAD>
<BODY leftMargin=0 topMargin=0>
<object id=richedit style=”BACKGROUND-COLOR: buttonface”
data=”richedit.html” width=”100%” height=”100%” type=”text/x-scriptlet”
VIEWASTEXT>
</object>

<SCRIPT language=”JavaScript”>
var edit = window.dialogArguments;
</SCRIPT>

<SCRIPT language=”JavaScript” event=”onload” for=”window”> window.returnValue = null; if (edit.defaultFont) richedit.defaultFont = edit.defaultFont; if (edit.defaultFontSize) richedit.defaultFontSize = edit.defaultFontSize; if (edit.styledata) richedit.styledata = edit.styledata richedit.docHtml = edit.src;
</script>
<SCRIPT language=”JavaScript” event=”onscriptletevent(name, eventData)”
for=”richedit”>
//window.returnValue = eventData;
window.returnValue = richedit.docHtml;
window.close();
</script>

</BODY></HTML>