...

YUI simple text editor - not saving changes

ktsixit
11-27-2008, 08:57 AM
Hi all,
I'm using the YUI Simple Editor (http://developer.yahoo.com/yui/examples/editor/simple_editor.html) in my page. It's a page for updating data in website and the problem is that the changes I make to the text with the editor, are not saved. Actually the sql query that is submitted to the database contains the old text and not the changed updated text. It seems that changes on text are only visual.

Has anybody faced the same problem with this script? Can you imagine what's the cause for this? Help me pls :(

the html/php is:
<textarea id="text" name="text" rows="20" cols="75">
<?php echo $row_show_new['text']; ?>
</textarea>

and the javascript code that creates editor is:
<script>
(function() {
var Dom = YAHOO.util.Dom,
Event = YAHOO.util.Event;

var myConfig = {
height: '100px',
width: '500px',
dompath: true,
focusAtStart: false
};

YAHOO.log('Create the Editor..', 'info', 'example');
var myEditor = new YAHOO.widget.SimpleEditor('text', myConfig);
myEditor.render();

})();
</script>

danny_mk
06-03-2009, 01:41 AM
This is a quote from the YUI documentation:
...............................................................................
Getting the data from the Editor

There are a couple of ways to get the data from the editor. The first way is to let the Editor do it for you by setting the handleSubmit configuration option.

Setting the handleSubmit configuration option, the Editor will attempt to attach itself to its parent form's submit event. Then it will call its saveHTML method, then proceed with the form submission.
--------------------------------------------------------

simply set
handleSubmit: true
in your configuration options.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum