TIMEX
TIMEX

Reputation: 271604

How do I change CKEditor so that it doesn't automatically put <p></p> inside the textarea?

I'm following the tutorial of CKEditor, and I did this:

 $( '#editor' ).ckeditor(function(){});  //great works!!

But now...when I submit the form...I see that by default, the textarea has <p></p>. How do I make it "nothing" by default?

Upvotes: 1

Views: 215

Answers (2)

davehale23
davehale23

Reputation: 4372

I am using this

CKEDITOR.instances.MainContent_notificationText.setData( '' );

for my non-jQuery plugin version and it works great.

For your jQuery plugin you could use

$('#editor').ckeditor(function(){
  this.setData("");
});

Upvotes: 1

Darin Dimitrov
Darin Dimitrov

Reputation: 1038710

Try setting the following config values:

CKEDITOR.config.enterMode = CKEDITOR.ENTER_BR;
CKEDITOR.config.shiftEnterMode = CKEDITOR.ENTER_P;

Make sure that you clear your browser cache when you modify them as changes might not be picked up automatically.

Upvotes: 3

Related Questions