Joe689 Posted May 1, 2007 Share Posted May 1, 2007 <? include('admin_header.php'); require_once('../classes/property.class.php'); if ( isset( $_GET['id'] ) && !empty( $_GET['id'] ) ) { $id = $_GET['id']; $property = new Property($id); // Submitted form, Save the property if($_POST['submit']) { $property->set_property_notes(stripslashes($_POST['notes'])); if (empty($property->error) && $property->save()) { $message = $property->get_property_long_name() . " successfully edited."; } else { $message = display_error($property->error); } } } else { echo "There was an error in your request."; } ?> <h3>View Properties</h3> <table id="content"> <tr> <th align="center"><a href="?order=property_long_name" title="Order by Property Name">Property Name</a></th> <th align="center"><a href="?order=property_city" title="Order by Property City">City</th> <th align="center"><a href="?order=state_name" title="Order by Property State">State</th> <th align="center">Special</th> <th align="center">Actions</th> </tr> <? if ($list_property) { $class = true; while ($property = &$list_property->next()) { ?> <form name="RTE" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>?id=<? echo $property->get_property_id() ?>" onsubmit="return submitForm();"> <script language="JavaScript" type="text/javascript" src="/scripts/richtext_compressed.js"></script> <script> function submitForm() { updateRTEs(); return true; } </script> <script> initRTE("/scripts/images/", "/scripts/", "", false); </script> <script> var rte1= new richTextEditor('notes'); rte1.html = '<?= rteSafe($property->get_property_notes()) ?>'; rte1.build(); </script> </script> </td> <td> <input type="hidden" name="id" value="<?= $property->get_property_id() ?>"> <input type="submit" name="submit" value="Update"> </form> </td> </tr> <? $class = ! $class; } } else { ?> <tr> <td align="center"><br>No Properties Available.</td> </tr> <? } ?> </table> P.S. I have taken out much of code that isn't necessary Basically, the website displays all the property locations and displays their notes. I want the user to be able to change these notes using the rich text editor, and when submitted update the current notes. This is what I know: In order for the multiple Rich Text Editor's to behave properly, they must have a unique name. They can't all be named 'notes' although the var name can be the same. What is the best way, to dynamically change the name of the Rich Text Editor every time one is created during the while loop and have the _Post[varname] to match to the correct Rich Text Editor. I do know, that if I have only one Rich Text Editor, meaning no while loop creating multiple, this script works perfectly Link to comment https://forums.phpfreaks.com/topic/49383-need-help-with-_post-w-multiple-rich-text-editors/ Share on other sites More sharing options...
AndyB Posted May 1, 2007 Share Posted May 1, 2007 Just for future reference, please post code between CODE tags, and don't intentionally use large bold text for your questions (except where aimed at the visually challenged). Link to comment https://forums.phpfreaks.com/topic/49383-need-help-with-_post-w-multiple-rich-text-editors/#findComment-241997 Share on other sites More sharing options...
Joe689 Posted May 1, 2007 Author Share Posted May 1, 2007 Sorry didn't know there were code tags, so used larger text to seperate it from the code Link to comment https://forums.phpfreaks.com/topic/49383-need-help-with-_post-w-multiple-rich-text-editors/#findComment-242001 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.