I found this excellent rich text editor on dynamic drive, got it working to display, but I cannot figure out what the variable is is storing the value that I would write to the db.
If I am not mistaken, it shoud be "+document.myform.rte1.value" and so I would just need to create the sql statement to record that value to the db. I am not familiar with the "+" so I am not sure exactly what I am doing here.
PHP Code:
<?php // start session session_start(); // set up some global variables @include 'menu.php'; if(isset($_POST['rte1'])){ //sql here echo '<html><head>'; echo '<META HTTP-EQUIV="REFRESH" CONTENT="4;URL=display_project_list.php">'; echo '</head><body>Suggestion saved.</body></html>'; die; }
?> <html><head> <script language="JavaScript" type="text/javascript" src="richtext.js"></script> </head> <body> <form name="update_suggestion" action="display_comment.php" method=post> <script language="JavaScript" type="text/javascript"> <!-- function submitForm() { //make sure hidden and iframe values are in sync before submitting form updateRTE('rte1'); //use this when syncing only 1 rich text editor ("rtel" is name of editor) //updateRTEs(); //uncomment and call this line instead if there are multiple rich text editors inside the form alert("Submitted value: "+document.myform.rte1.value) //alert submitted value return true; //Set to false to disable form submission, for easy debugging. } //Usage: initRTE(imagesPath, includesPath, cssFile) initRTE("images/", "", ""); //--> </script> <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> <button name="submit" type="submit" tabindex="25">Submit</button> </form> </body></html>
|