Jump to content

Content Editor and Saving Page Problem


GSimon

Recommended Posts

Hi, I downloaded this Javascript Content Editor (http://www.nicedit.com/) which works great.

 

The only problem is I can't figure out the Ajax which would allow a user to save the div content once they are done editing.

 

I have tried to figure this out using the help found here (http://wiki.nicedit.com/w/page/525/Saving%20via%20AJAX), and it work to an extent. But it you look at the picture below this is what happens when I click to edit the div and then hit 'Save'

 

index.php?action=dlattach;topic=346224.0;attach=16846;image

 

After I hit OK in the last part I refresh the page and everything is the same. So what part of the coding needs to change in order for me or users logged into my site to change the content then save it?

 

Thanks, here's the code on the site from the example I posted

 

<script>
var area1, area2

function toggleArea1() {
if(!area1) {
	area1 = new nicEditor({fullPanel : true, onSave : function(content, id, instance) {
    alert('save button clicked for element '+id+' = '+content);
  } }).panelInstance('myArea1',{hasPanel : true});
} else {
	area1.removeInstance('myArea1');
	area1 = null;
}
}

function addArea2() {
area2 = new nicEditor({fullPanel : true}).panelInstance('myArea2');
}
function removeArea2() {
area2.removeInstance('myArea2');
}

bkLib.onDomLoaded(function() { toggleArea1(); });
</script>
<script src="/nicEdit.js" type="text/javascript"></script>
<script type="text/javascript">bkLib.onDomLoaded(nicEditors.allTextAreas);</script>

<br />

<div id="myArea1" style="width:500px;height:300px">

Whats Up <img src="http://www.google.ca/intl/en_ALL/images/logos/images_logo_lg.gif" />

</div>

<button onClick="toggleArea1();">Toggle DIV Editor</button>

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/249495-content-editor-and-saving-page-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.