jQuery to pre-fill a form using tinyMCE RTE -
hope doing well. problem:
i have table generated foreach loop, want able click on specific cell in each row, should take data in cell , use pre-populate tinymce text area in dialog box. have far:
the td want target in each row:
<td class="cmts" id="id">comments</td>
the dialog want pre-fill before(or after opening):
<div id="cmts_dialog" name="cmnts_dialog" title="comments"> <form id="cmnts_dialog_form" name="cmnts_dialog_form"> <fieldset> <textarea id="comments_input" name="comments_input"></textarea> </fieldset> </form> </div>
i'm trying populate textarea jquery far doesn't work:
$(document).on('click','.cmnts',function(){ $('#comments_input').val($(this).text()); })
i can dialog stuff figured best method populate text area before use .dialog('open'), i'm open solutions
any appreciated. :]
found answer in api docs tinymce
tinymce.get('comments_input').setcontent($(this).text());
Comments
Post a Comment