I want to multi instance the editor on the same page, I have the samepage for sumitting the news
for which I am using this code
<?php
include("FCKeditor/fckeditor.php");
$oFCKeditor = new FCKeditor('news_description');
$oFCKeditor->BasePath = 'FCKeditor/';
$oFCKeditor->Value = nl2br($htmlData);
$oFCKeditor->Create();
?>
and for editing the the news I used this code which only loads the editor for the first item but all other Item don't show the proper editor please help me in the second one
here is the important code which causing error
<?php /////////////////////////////////////////////////////////////////////////////////////// include('common/pagingprocess.php'); /////////////////////////////////////////////////////////////////////////////////////// $sql .= " LIMIT ".$start.",".$limit; $i=$i+$start; $result = @mysql_query($sql); $rec = array(); while( $row = @mysql_fetch_array($result) ) { $rec[] = $row; } if(count($rec)>0) { foreach($rec as $items) { ?> <tr> <td><?php echo ++$i;?> </td> <td><?php echo $items['news_heading'];?> </td> <td><?php echo $items['news_description']; ?> </td> <td><?php $timestamp= strtotime($items['date_added']); echo strftime('%d %B %Y %X', $timestamp); ?> </td> <td><?php if($items['news_status'] == 1) echo "Active"; else echo "Inactive"; ?> </td> <div id="dialog_<?php echo $items['news_id']; ?>" title="<?php echo $items['news_heading'];?>" style="display:none;"> <p><img src="<?php echo ru_media; ?>news_image/<?php echo $items[news_image] ;?>" /></p> </div> <td valign="middle"> <img src="<?php echo ru_img;?>viewIcon.gif" style="cursor:pointer;" title="Edit News" id="logo_<?php echo $items['news_id'];?>" onclick="modelme(<?php echo $items['news_id'];?>)" /> <img src="<?php echo ru_img;?>edit.gif" style="cursor:pointer;" title="Edit News" onclick="document.getElementById('<?php echo $items['news_id'];?>').style.display='block'" /> <img src="<?php echo ru_img;?>dlt.gif" style="cursor:pointer;" title="Delete News" alt="Delete News" onclick="if(confirm('Are sure you want to delete')){window.location='<?php echo ruadmin; ?>process/process_news.php?p=del&id=<?php echo $items["news_id"];?>&script=news' }" /> </td> </tr> <tr> <td colspan="7" align="right"> <div id="<?php echo $items["news_id"];?>" style="display:none;"> <form name="form1" enctype="multipart/form-data" action="<?php echo ruadmin; ?>process/process_news.php?p=editnews&id=<?php echo $items["news_id"];?>&script=news" method="post"> News Heading: <input type="hidden" name="editnews" id="editnews" value="<?php echo $items['news_id'];?>"/> <input type="text" name="edit_news_heading" id="edit_news_heading" size="30" class="text-input" value="<?php echo $items['news_heading'];?>"/><br /> News Detail: <textarea name="edit_news_detail" id="edit_news_detail" class="text-input_large" rows="20"><?php echo $items['news_description'];?></textarea> <script type="text/javascript"> if (CKEDITOR.instances['editor']) { delete CKEDITOR.instances['edit_news_detail']; } var editor = CKEDITOR.replace('edit_news_detail'); /* =====INSTANCE====== */ var instance = CKEDITOR.instances.content; instance.updateElement(); $("#output").attr("value",instance.getData()); </script> <br /> News Image: <input type="file" id="edit_news_image" name="edit_news_image" class="text-input small-input"> Please Upload Image Size <input type="hidden" name="oldimage" id="oldimage" value="<?php echo $items['news_image'];?>"/><br /> News Status: <input type="checkbox" name="edit_news_status" id="edit_news_status" value="kashif" <?php if ($items['news_status']==1) echo "checked=checked"; ?>/><br /> <input type="submit" class="button" name="submit" value="Update" /> <input type="button" value="Cancel" class="button" onclick="document.getElementById('<?php echo $items['news_id'];?>').style.display='none'" /> </form> </div> </td> </tr> <?php } } ?>