Right now, using Alfonso's plugin, I'm able to add the placeholder attribute in config.js. However, since I'm adding into config.js, that means all instances will have the same placeholder text, right?
Well, I don't want all instances of my ckeditor to have the same placeholder text because I also noticed he also said :
The value can be set in the configuration or as an attribute of the replaced element
I figured this means that we can put "Type something..." as placeholder text for ckeditor1 and "Blabla..." as placeholder text for ckeditor2. How do I do that? Or that's not what he meant?
I have tried several ways including
var ckeditor = CKEDITOR.replace('ckeditor1');
ckeditor.placeholder = 'Type sometheing....';
and
var config = [];
config['placeholder'] = 'some value'; //or config = [{placeholder:'some value'}]
CKEDITOR.replace("myeditor" , config );
inside that particular page but to no avail... I've also cleared my cache.
By an attribute I meant:
<textarea name="editor" placeholder="Type here..."></textarea>
with regards to your other approaches, the configuration is an object, so this should work:
var config = {};
config.placeholder = 'some value';
CKEDITOR.replace("myeditor" , config );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With