PDA

View Full Version : Form Idiot needs help w/ Rich Text Editor



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>

ddadmin
01-24-2006, 02:20 PM
Do you have a server side script for processing the form contents? There is nothing magical about the rich text editor- it merely makes entering formatted text inside a form easier. You still need a server side script for accepting the form contents and then processing it somehow. For a list of PHP form processor scripts, see here: http://php.resourceindex.com/Complete_Scripts/Form_Processing/

myyoungfamily
01-25-2006, 06:34 AM
I found a solution...

www.snippetmaster.com

It's a simple concept and very easy to implement into an existing or new site.


(here are some keywords so when people search for something like this they won't have as much trouble as I did: form, php, web, site, content, editor, edit, management, manager, administration, admin, wysiwyg, rich, text)