Feedback
Even thought this really seems easy, I believe there's stuff missing.
I'm trying to make jquery and TinyMCE works together in ajax mode (silent submit and reload), but I really can't get anything working... some help would be appreciated.
romain
May 16, 2008
#1
"tinyMCE.triggerSave();" was all it took. I just wish I read your entry 4 hours earlier :) would have saved the headache.
Mark L.
June 12, 2008
#2
ghjghjghj
guga
August 26, 2008
#3
Thanks bro! I was totally bamboozled as to why it wasn't working before finding your post.
Paul S
September 2, 2008
#4
Thanks, saved me after a few hours of head scratching!
Karl
September 26, 2008
#5
This may be a dumb question, but where, in the Drupal code, do you put the "tinyMCE.triggerSave();" line?
And would you just place this:
"tinyMCE.init({
mode : "textareas",
theme : "simple",
editor_selector : "wysiwyg"
});"
in the <head> tag of page.tpl.php?
Thanks!
PS. Basically I am just not getting what the step my step is to implement this code. Thanks again!
Scott
October 22, 2008
#6
Thank you very much. I had a nasty but where TinyMCE and jQuery were fighting which was also disabling or breaking Firebug. The TinyMCE wiki does not clearly address this (that I can see).
Changing to running init with mode "none" and then calling mceAddControl solved my problem perfectly.
Jason Smith
December 14, 2008
#7
thanks! great tip!
cwd
May 2, 2009
#8
Where does this go ?
$('form').bind('form-pre-serialize', function(e) {
tinyMCE.triggerSave();
});
June 4, 2009
#9
Thanks a lot! What a nightmare!
Jon
June 5, 2009
#10
Thanks, you saved my day. I couldn't find anywhere else why jquery was fighting with tinymce!
Andrea
June 10, 2009
#11
Doh! If I only had googled for "tinymce jquery ajax form" earlier! Great post, mate!
TomM
June 18, 2009
#12
thanks so much - you saved me a ton of time trying to figure that one out!
Dan Pickett
June 22, 2009
#13
Thanks!
marss
July 28, 2009
#14
Thank you very much... I Love YOU!!!
darcon3371
August 24, 2009
#15
Really easy and great solution, saved me what would be hours of work. Thanks for the answer!
Gingah
August 25, 2009
#16
You safe my life!
Thanks God.
aifarfa
October 1, 2009
#17
This is exactly what I needed. Awesome
maxleb
October 13, 2009
#18
Brilliant. Thank you
Dave
October 24, 2009
#19
You sure saved me a lot of time! Thanks for this very helpful post.
Kathryn
October 30, 2009
#20
Thanks!!!! Wish I read your page a few hours earlier ;-)!
Jordy
November 11, 2009
#21
Nice post! Thx!
Jan
January 13, 2010
#22
LifeSaver. Tks.
Mauricio Wolff
February 5, 2010
#23
Great!!! thanks
RoloTomasi
February 10, 2010
#24
hi, i got two textareas in my form and i would like to keep the second one as a simple textarea. how can i target a specific textarea to be replaced by tinyMCE ?
thanks anyway
imed
February 11, 2010
#25
ok, i think i got the solution :
init tinyMCE with : mode : "none",
then add tinyMCE control to the specific textarea by passing its ID : tinyMCE.execCommand('mceAddControl', false, 'idTargetedTextarea');
imed
February 11, 2010
#26
it was just in front of me (shame!!)
thx
imed
February 11, 2010
#27
Obrigado !!!
Ou melhor ...Thanks !!! ;)
Daniel Medeiros
March 3, 2010
#29
I don't get this solution to work. :(
Please can you post an example...?
Shaaa
May 7, 2010
#31
Fantastic. Thank you - much appreciated.
Damian
June 11, 2010
#32
Thanks.
Nice post :)
quangpd
July 3, 2010
#33
Cool. The elegant solution he was seeking. Thanks!
EDB
July 15, 2010
#34
good job, thanks!
marcus
July 25, 2010
#35
You saved my day, thanks.
: )
August 2, 2010
#36
Thank you soooo much. Just solved my half-day problem.
Aquarius
August 29, 2010
#37
I actually wasn't able to use your post in anyway. However I just love your comments area. Especially the use of only two fields to get all the important information (text & user).
Do you support HTML in here? What about code blocks?
tinyMCE.triggerSave();
David
September 3, 2010
#38
Thank you David. No HTML, only code blocks :)
Jérôme Jaglale
September 3, 2010
#39
Very useful but a demo is really needed, the snippet could go anywhere, bit of a guess work solution
Pete
October 12, 2010
#40
Thanks
tinyMCE.triggerSave(); was the solution for me.
As far as I understand: it brings the content from the tinyMCE editor to the HTML textarea element, so we can finally get the content with jquery
either
$("#textarea_name").html();
or
$("#textarea_name").serializeArray() as data to send with an ajax call
Flo.
October 22, 2010
#41
???????????????????????????????
??????????
November 10, 2010
#42
Thank you so much. This is really helpful.
Visitor
January 14, 2011
#43
thanks alot
Muhammad Zubair
February 2, 2011
#44
triggerSave saved my da..erhm, night :) Thx!
shcodenick
February 19, 2011
#45
tinyMCE.triggerSave(); thanks you
dungninhbinh
March 23, 2011
#46
Thanks for the article man ... saved me from serious headache...
Robert B.
March 31, 2011
#47
hi
dev narayan
April 28, 2011
#48
Important: If you call tinymce() twice or more times on the same textarea, save() will be not working probably.
So, I fixed this by removing class:
$('textarea.tinymce').each(function(){
$(this).removeClass('tinymce');
.......
olamedia
May 7, 2011
#49
I'm using ASP.NET AJAX (using an UpdatePanel). Turns out, I didn't need the form plugin and the triggerSave method.
However, your post gave me a big clue: putting the TinyMCE initialisation code OUTSIDE the jQuery document ready block sorted it for me.
Richard Fawcett
May 19, 2011
#50
i have jsp page in which the contents are calling from another jsp using ajax.In the second jsp file threre is textarea is there.i have used the tiny mce script for the text area.but on ajax call it is not loaded in the first jsp file...please help me..i am in troubel
rahul
June 29, 2011
#51
Thanks !! It helped me with work on my project :)
Tomas Drozda
July 14, 2011
#52
Thanks a lot! I just needed to add tinyMCE.triggerSave();
Mike Maisuradze
July 29, 2011
#53
Nice! Just what I needed!
<a href="GechoDesigns.com">GechoDesigns</a>
Dominic
August 2, 2011
#54
very helpful
Amir
August 4, 2011
#55
excelente!! gracias
jose damian
August 12, 2011
#56
Habe alles brauchen können! Danke!
UK
August 16, 2011
#57
Great thanks, saved me some head-scratching!
ND
August 23, 2011
#58
So it's very helpful trick! Thnx!
sierjKhaletski
August 31, 2011
#59
That was great, thank you so much!
Tulio
September 5, 2011
#60
So it sound like trick
September 29, 2011
#61
Million thanks!!!
Panos
October 8, 2011
#62
for everyones reference, I was also able to add a triggerSave to the submit handler using a tinymce jquery call like this (where i have a form with an id of "content_form" and a tinymce textarea with an id of "content":
$(document).ready(function(){
$('#content').tinymce({
....stuff in here...
});
$('#content_form').submit(function(){
tinymce.triggerSave();
});
});
.. and as an alternative, this also worked...
$(document).ready(function(){
$('#content').tinymce({
....stuff in here...
});
$('#content_form').submit(function(){
$('#content').val(tinymce.get('content').getContent());
});
});
Hope that can help someone too
Jordan
November 3, 2011
#63
This was very helpful! the triggerSave() was all I needed, thank your VERY much for sharing this information!
Regards,
Erik
Erik
November 19, 2011
#64