Hallo...
When try using ajax and TinyMce, I got problem that is the content from
editor is read but does not update. so use code like this to be update is
read by post.
$('#form_edit_products').live("submit", function(e){
e.preventDefault();
$("#loading_top").css({"display":"block"});
if (working) return false;
working = true;
// Using our storePOST wrapper method to send data
// via a POST AJAX request:
var product_description = tinyMCE.get('product_description');
product_description =
encodeURIComponent(product_description.getContent());
var data =
$(this).serialize()+'&product_description='+product_description;
$.storePOST(url, 'submitProduct', data, function(r){
r.payload.script.replace(new RegExp( "\r\n", "g" ),
r.payload.script);
$("#info-message").html(r.payload.html);
$.globalEval(r.payload.script);
$("#loading_top").fadeOut('normal');
working = false;
return false;
});
working = false;
$("html, body").animate({scrollTop:100}, 'slow');
return false;
});
Please, look at field product_description I use this twice because in
$(this).serialize() product_description read old content. so add
encodeURIComponent(product_description.getContent()) one more to be read
last update content from editor of tinyMce.
This is result from firebug
media_cover6872options_color[]Blackoptions_color[]Dark Blueoptions_color[]
Redoptions_color[]Whiteoptions_color[]Brownoptions_color[]Gray
options_color[]
options_name[]
options_size[]Loptions_size[]
options_value[]
product_brand
product_category[]100product_category[]117product_category[]118product_code
RG501*product_description**<p>Test</p>**product_description**<p>Test</p>
<p>Test
Updated</p>*product_discount_price0.00product_height0.00product_id15035
product_length0.00product_media_id[]6872product_media_id[]6873
product_media_id[]6874product_nameKaos Vintage - RG501
Look at bold, the first product_description is from form.serialize() and
the second from var data =
$(this).serialize()+'&*product_description='+product_description
*Thanks
Best Regards
Saiful Amri
**
On Tue, Oct 16, 2012 at 8:12 PM, Saiful Amri <[email protected]> wrote:
> Good, now I got it and I understand how to save a content of tinyMce
> Editor.
>
> Furthermore, I am sorry it is a little out of TB thread. I want to know,
> is there any way to call tinyMce editor using ajax without refresh page? it
> still fail to display editor of tinyMce in a div using ajax directly, the
> editor is no displayed. But when without ajax it is good displayed.
>
> thanks...
>
> Best Regards
>
> Saiful Amri
>
>
>
> On Tue, Oct 16, 2012 at 7:48 PM, Barry vd. Heuvel <[email protected]>wrote:
>
>> the timeout is not needed, see this fiddle:
>> http://fiddle.tinymce.com/Nncaab
>>
>> Or the jQuery version: http://fiddle.tinymce.com/Pncaab (ajax is
>> commented out, but something like that should work)
>>
>> Anyways, good luck ;)
>>
>>
>> On Tue, Oct 16, 2012 at 12:20 PM, Saiful Amri <[email protected]>wrote:
>>
>>> I have tried using ajax like your function for the first time using
>>> tinyMce or FckEditor (now CKeditor) but both worked on second submit, not
>>> on first submit form data. So, I decided not using ajax even thought I am
>>> interested using with ajax.
>>>
>>> Now, I found the solution from you and all.
>>>
>>> When look at the source code of the demo on tinyMce about this ajax. I
>>> think that why data just saved on second submit, it needs setTimeout to get
>>> content.
>>>
>>> Thanks, I will update my source code and using it.
>>>
>>> Best Regards
>>>
>>> Saiful Amri
>>>
>>>
>>>
>>> On Tue, Oct 16, 2012 at 4:57 PM, Barry vd. Heuvel <[email protected]>wrote:
>>>
>>>> Not sure, I have been using for years.
>>>>
>>>> First, you had to use triggersave, before saving, but for atleast 1
>>>> year, I just do
>>>> $.post(url, form.serialize(), function (data){..}
>>>> and it works fine..
>>>>
>>>> On Tue, Oct 16, 2012 at 4:36 AM, Saiful Amri <[email protected]>wrote:
>>>>
>>>>> Hallo Barry...
>>>>>
>>>>> Awesome! Barry, that is what I mean. Last time ( I use Version 3.5b2
>>>>> (2012-03-15), now Version: 3.5.7) when I google about that AJAX
>>>>> Compatible, I didn't found demo about it, and in TinyMce demo page too.
>>>>>
>>>>> So long time, I didn't visit TinyMce, is that new demo and
>>>>> compatibility? when it is added by TinyMce?
>>>>>
>>>>> Thanks,
>>>>>
>>>>>
>>>>> Best Regards
>>>>>
>>>>> Saiful Amri
>>>>>
>>>>>
>>>>> On Tue, Oct 16, 2012 at 3:37 AM, Barry vd. Heuvel
>>>>> <[email protected]>wrote:
>>>>>
>>>>>> Why not? There is an example for ajax save/load;
>>>>>> http://www.tinymce.com/tryit/ajax_load_save.php
>>>>>>
>>>>>>
>>>>>> On Mon, Oct 15, 2012 at 9:58 PM, Saiful Amri
>>>>>> <[email protected]>wrote:
>>>>>>
>>>>>>> Hello...
>>>>>>>
>>>>>>> Thank you for all of your answers, I mean that, how to using editor
>>>>>>> for web like TinyMCE or other editors in BT that support ajax when save
>>>>>>> the
>>>>>>> content of editor into a database in add or edit operation of a
>>>>>>> content. I
>>>>>>> found that TinyMCE or CKeditor does not support saving directly using
>>>>>>> ajax
>>>>>>> without refresh page. Maybe, they are using Iframe on background
>>>>>>> editor, so
>>>>>>> we ca not save a content using ajax directly, the content can not be
>>>>>>> read
>>>>>>> when saving into a database.
>>>>>>>
>>>>>>>
>>>>>>> thanks
>>>>>>>
>>>>>>> Best Regards
>>>>>>>
>>>>>>> Saiful Amri
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Tue, Oct 16, 2012 at 12:03 AM, Barry Carlyon <
>>>>>>> [email protected]> wrote:
>>>>>>>
>>>>>>>> I don't think he was after a offline html editor/programmer/dev
>>>>>>>> environment.
>>>>>>>>
>>>>>>>> But after something like TinyMCE that WordPress uses for its post
>>>>>>>> editor...
>>>>>>>>
>>>>>>>> I could be wrong tho. Original post is a little unclear really.
>>>>>>>>
>>>>>>>> Sent from my iPad
>>>>>>>>
>>>>>>>> On 15 Oct 2012, at 17:54, Eric Fookes <[email protected]> wrote:
>>>>>>>>
>>>>>>>> If you're using Windows, you might like to give NoteTab a try. It's
>>>>>>>> currently the only code-based HTML editor that supports Bootstrap (v
>>>>>>>> 2.1.1).
>>>>>>>>
>>>>>>>> Building a Bootstrap page with NoteTab is really easy. First open
>>>>>>>> the included Bootstrap Clip library in NoteTab and then drag-and-drop
>>>>>>>> Bootstrap snippets into your document. Most of these pop up a dialog
>>>>>>>> box
>>>>>>>> that lets you select options and fill-in fields before the completed
>>>>>>>> code
>>>>>>>> is pasted in your page. You'll find more details and some screenshots
>>>>>>>> here:
>>>>>>>>
>>>>>>>> http://www.notetab.com/html-editor.php#Clips
>>>>>>>>
>>>>>>>> NoteTab is available in several editions, including a free one
>>>>>>>> called NoteTab Light.
>>>>>>>>
>>>>>>>> Full disclosure: we are the developers of NoteTab.
>>>>>>>>
>>>>>>>> On Monday, March 26, 2012 4:02:16 PM UTC+2, Saiful Amri wrote:
>>>>>>>>>
>>>>>>>>> Hello, Is there any suitable editor for bootstraps?
>>>>>>>>>
>>>>>>>>> I have been tried tinyeditor, but it does not support ajax for
>>>>>>>>> calling editor...
>>>>>>>>>
>>>>>>>>> Wysiwyg editor good, but still bad in design....
>>>>>>>>>
>>>>>>>>> Btw, how to post something using ajax + Wysiwyg?
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>
>