myyoungfamily
01-23-2006, 10:22 PM
Call me an idiot or whatever you want but this is something I've never done...
http://www.dynamicdrive.com/dynamicindex16/richtexteditor/index.htm
I am trying to make a simple way for my web site customers to update text on pages within their site. Could somebody help me with a sample form that would update at .txt or htm document. That document would be avalible to be viewed on the site throught an iframe or something. I tried to use the demo from the link above but I don't know how to get a form to post to a file.
Don't laugh, but here's what I got so far...
<script language="JavaScript" type="text/javascript" src="richtext_compressed.js"></script>
</head>
<body>
<table width="520" height="500" CELLPADDING=0 CELLSPACING=0>
<tr>
<td width="520" align="center">
<form name="RTEDemo" action="news.txt" method="post" onsubmit="return submitForm();">
<script language="JavaScript" type="text/javascript">
<!--
function submitForm() {
//make sure hidden and iframe values are in sync before submitting form
//to sync only 1 rte, use updateRTE(rte)
//to sync all rtes, use updateRTEs
updateRTE('rte1');
//updateRTEs();
alert("rte1 = " + document.RTEDemo.rte1.value);
//change the following line to true to submit form
return false;
}
//Usage: initRTE(imagesPath, includesPath, cssFile)
initRTE("images/", "", "");
//-->
</script>
<noscript><p><b>Javascript must be enabled to use this form.</b></p></noscript>
<script language="JavaScript" type="text/javascript">
<!--
//Usage: writeRichText(fieldname, html, width, height, buttons, readOnly)
writeRichText('rte1', 'here's the "<em>preloaded</em> <b>content</b>"', 400, 200, true, false);
//-->
</script>
<p>Click submit to show the value of the text box.</p>
<p><input type="submit" name="submit" value="Submit"></p>
</form>
</td>
</tr>
</table>
</body>
http://www.dynamicdrive.com/dynamicindex16/richtexteditor/index.htm
I am trying to make a simple way for my web site customers to update text on pages within their site. Could somebody help me with a sample form that would update at .txt or htm document. That document would be avalible to be viewed on the site throught an iframe or something. I tried to use the demo from the link above but I don't know how to get a form to post to a file.
Don't laugh, but here's what I got so far...
<script language="JavaScript" type="text/javascript" src="richtext_compressed.js"></script>
</head>
<body>
<table width="520" height="500" CELLPADDING=0 CELLSPACING=0>
<tr>
<td width="520" align="center">
<form name="RTEDemo" action="news.txt" method="post" onsubmit="return submitForm();">
<script language="JavaScript" type="text/javascript">
<!--
function submitForm() {
//make sure hidden and iframe values are in sync before submitting form
//to sync only 1 rte, use updateRTE(rte)
//to sync all rtes, use updateRTEs
updateRTE('rte1');
//updateRTEs();
alert("rte1 = " + document.RTEDemo.rte1.value);
//change the following line to true to submit form
return false;
}
//Usage: initRTE(imagesPath, includesPath, cssFile)
initRTE("images/", "", "");
//-->
</script>
<noscript><p><b>Javascript must be enabled to use this form.</b></p></noscript>
<script language="JavaScript" type="text/javascript">
<!--
//Usage: writeRichText(fieldname, html, width, height, buttons, readOnly)
writeRichText('rte1', 'here's the "<em>preloaded</em> <b>content</b>"', 400, 200, true, false);
//-->
</script>
<p>Click submit to show the value of the text box.</p>
<p><input type="submit" name="submit" value="Submit"></p>
</form>
</td>
</tr>
</table>
</body>