Accept my apologize because of my low English level
I use to load a page with jQuery and I use nicEdit in that page and I post datas to another page with jQuery. But it just send empty value instead of what user wrote in editor (if i define a default value for my text area, it just send the default value not the text wrote by user). What is the problem and what is the solution?
Thanks.
UPDATE After reading this related article and it's comments at end and reading other articles i found must use this way before submiting form :
nicEditors.findEditor('textarea_id').saveContent();
For this i use jquery to select any textarea and call .each()
jquery function. For example :
$('textarea').each(function(){
var IDOfThisTextArea = $(this).attr('id');
nicEditors.findEditor(IDOfThisTextArea).saveContent()
});
This work fine for textarea that created beforehand. But I have some textarea that created dynamically via jQuery that findEditor()
function above didn't found those and not call saveContent()
for those.
For this problem what you offer??????
tnx
What about saving all instances like this before you submit the form
$('input[type=submit]').bind('click', function () {
for(var i=0;i<nicEditors.nicInstances.length;i++){
nicEditors.nicInstances[i].saveContent();
}
});