Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
86
rated 0 times [  87] [ 1]  / answers: 1 / hits: 19243  / 10 Years ago, tue, february 3, 2015, 12:00:00

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.


More From » jquery

 Answers
22

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 );

[#67966] Sunday, February 1, 2015, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tobyl

Total Points: 598
Total Questions: 110
Total Answers: 114

Location: Vietnam
Member since Sat, Feb 12, 2022
2 Years ago
tobyl questions
Tue, Aug 10, 21, 00:00, 3 Years ago
Wed, Jan 13, 21, 00:00, 3 Years ago
Tue, Dec 1, 20, 00:00, 4 Years ago
;