Hello,
I'm writing a form which have some select fields and textarea(ckeditor).
When user changes select fields, filebrowserurl should change(adding some values to querystring).
I wrote that:
<select id="type"> <option value="1">type 1</option> <option value="2">type 2</option> </select> <textarea id="Description"></textarea>
CKEDITOR.replace('Description',{filebrowserBrowseUrl : '/path/to/browser.php'}); $("#type").on("change",function(){ var t = $(this).val(); CKEDITOR.instances.Description.destroy(); CKEDITOR.replace('Description',{filebrowserBrowseUrl : '/path/to/browser.php?type=' + t}); });
Is that the right way? Is there any more optimized way to do that?
You can find full example here:
http://jsfiddle.net/rq6hG/
Thanks for reply