Support

Account

Home Forums Backend Issues (wp-admin) Update a tinymce textarea via javascript Reply To: Update a tinymce textarea via javascript

  • OK, here’s a better version. You have to find your ACF field, find the textarea within the editor, get that ID, then setContent using TinyMCE JS API:

    
    var description = "Some text!";
    var f = acf.getField("field_5d5231b7e8738");
    var tinyID = f.$el.find("textarea").attr("id");
    var tinyInstance = tinyMCE.editors[tinyID];
    tinyInstance.setContent(description);
    

    Worked well for me, let me know how it goes.