How to get ckeditor field value in modelform after submit in Django2.1?How do I sort a list of dictionaries by a value of the dictionary?How to get the ASCII value of a character?How do I return multiple values from a function?How to get the current time in PythonHow do I sort a dictionary by value?How do I get the number of elements in a list?How to access environment variable values?Can't add field to ModelForm at __init__Cannot display HTML stringDjango-Rest-Framework - How to serialize queryset from an unrelated model as nested serializer
Was there an original & definitive use of alternate dimensions/realities in fiction?
Can users with the same $HOME have separate bash histories?
Squares inside a square
What is the definition of Product
How secure are public hashed passwords (with a salt)?
Can a system of three stars exist?
The 7-numbers crossword
How can I improve my formal definitions?
Does a Rogue's proficiency with a Rapier apply to the Spiral Rapier?
Is the equational theory of groups axiomatized by the associative law?
Why do we need explainable AI?
Can UV radiation be safe for the skin?
Why is the output of this find -newermt command apparently not in order?
Why do modes sound so different, although they are basically the same as a mode of another scale?
German equivalent to "going down the rabbit hole"
What are the electrical characteristics of a PC gameport?
Is Borg adaptation only temporary?
Why do motor drives have multiple bus capacitors of small value capacitance instead of a single bus capacitor of large value?
Is there anything in the universe that cannot be compressed?
Doesn't the concept of marginal utility speak to a cardinal utility function?
Displaying Time in HH:MM Format
Why wasn't Linda Hamilton in T3?
Pandas transform inconsistent behavior for list
How do I get my neighbour to stop disturbing with loud music?
How to get ckeditor field value in modelform after submit in Django2.1?
How do I sort a list of dictionaries by a value of the dictionary?How to get the ASCII value of a character?How do I return multiple values from a function?How to get the current time in PythonHow do I sort a dictionary by value?How do I get the number of elements in a list?How to access environment variable values?Can't add field to ModelForm at __init__Cannot display HTML stringDjango-Rest-Framework - How to serialize queryset from an unrelated model as nested serializer
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
- I have installed ckeditor.
- Placed "path('ckeditor/', include('ckeditor_uploader.urls'))," in urls.py
- Placed "'ckeditor'," in INTALLED_APPS in settings.py
Placed
## CKEDITOR CONFIGURATION ##
####################################
CKEDITOR_JQUERY_URL = 'https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js'
CKEDITOR_UPLOAD_PATH = 'uploads/help/'
CKEDITOR_IMAGE_BACKEND = "pillow"
CKEDITOR_CONFIGS =
'default':
'toolbar': None,
'height':100,
'width':500,
,
###################################at the end of file in settings.py
models.py :
from ckeditor.fields import RichTextField
from django.db import models
class Help(models.Model):
title = models.CharField(max_length=255)
description = RichTextField(blank=True, null=True) #models.TextField()
class Meta:
managed = False
db_table = 'help'
def __str__(self):
return self.titleforms.py
from ckeditor.widgets import CKEditorWidget
from django import forms
class HelpForm(ModelForm):
description = forms.CharField(widget=CKEditorWidget())
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
class Meta:
model = Help
exclude = ('created_by', 'updated_by', 'created', 'updated')help.html
% load i18n static widget_tweaks %
<form id="newFrm" method="post" novalidate>
% csrf_token %
form.media
<div class="col-lg-6 col-md-8 col-sm-12 col-xs-24">
<div class="form-group">
<label for="">description <span class="required">*</span></label>
% if form.title.errors %
% render_field form.description class="form-control ckeditor error" placeholder="Description" %
<div class="error-msg show form-error">
form.description.errors
</div>
% else %
% render_field form.description class="form-control ckeditor" placeholder="Description" %
% endif %
</div>
</div>
Question: I am not getting the POST value of description after form submit(in views.py). Any help will be appreciated. Thanks in advance.
python ckeditor modelform
add a comment |
- I have installed ckeditor.
- Placed "path('ckeditor/', include('ckeditor_uploader.urls'))," in urls.py
- Placed "'ckeditor'," in INTALLED_APPS in settings.py
Placed
## CKEDITOR CONFIGURATION ##
####################################
CKEDITOR_JQUERY_URL = 'https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js'
CKEDITOR_UPLOAD_PATH = 'uploads/help/'
CKEDITOR_IMAGE_BACKEND = "pillow"
CKEDITOR_CONFIGS =
'default':
'toolbar': None,
'height':100,
'width':500,
,
###################################at the end of file in settings.py
models.py :
from ckeditor.fields import RichTextField
from django.db import models
class Help(models.Model):
title = models.CharField(max_length=255)
description = RichTextField(blank=True, null=True) #models.TextField()
class Meta:
managed = False
db_table = 'help'
def __str__(self):
return self.titleforms.py
from ckeditor.widgets import CKEditorWidget
from django import forms
class HelpForm(ModelForm):
description = forms.CharField(widget=CKEditorWidget())
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
class Meta:
model = Help
exclude = ('created_by', 'updated_by', 'created', 'updated')help.html
% load i18n static widget_tweaks %
<form id="newFrm" method="post" novalidate>
% csrf_token %
form.media
<div class="col-lg-6 col-md-8 col-sm-12 col-xs-24">
<div class="form-group">
<label for="">description <span class="required">*</span></label>
% if form.title.errors %
% render_field form.description class="form-control ckeditor error" placeholder="Description" %
<div class="error-msg show form-error">
form.description.errors
</div>
% else %
% render_field form.description class="form-control ckeditor" placeholder="Description" %
% endif %
</div>
</div>
Question: I am not getting the POST value of description after form submit(in views.py). Any help will be appreciated. Thanks in advance.
python ckeditor modelform
add a comment |
- I have installed ckeditor.
- Placed "path('ckeditor/', include('ckeditor_uploader.urls'))," in urls.py
- Placed "'ckeditor'," in INTALLED_APPS in settings.py
Placed
## CKEDITOR CONFIGURATION ##
####################################
CKEDITOR_JQUERY_URL = 'https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js'
CKEDITOR_UPLOAD_PATH = 'uploads/help/'
CKEDITOR_IMAGE_BACKEND = "pillow"
CKEDITOR_CONFIGS =
'default':
'toolbar': None,
'height':100,
'width':500,
,
###################################at the end of file in settings.py
models.py :
from ckeditor.fields import RichTextField
from django.db import models
class Help(models.Model):
title = models.CharField(max_length=255)
description = RichTextField(blank=True, null=True) #models.TextField()
class Meta:
managed = False
db_table = 'help'
def __str__(self):
return self.titleforms.py
from ckeditor.widgets import CKEditorWidget
from django import forms
class HelpForm(ModelForm):
description = forms.CharField(widget=CKEditorWidget())
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
class Meta:
model = Help
exclude = ('created_by', 'updated_by', 'created', 'updated')help.html
% load i18n static widget_tweaks %
<form id="newFrm" method="post" novalidate>
% csrf_token %
form.media
<div class="col-lg-6 col-md-8 col-sm-12 col-xs-24">
<div class="form-group">
<label for="">description <span class="required">*</span></label>
% if form.title.errors %
% render_field form.description class="form-control ckeditor error" placeholder="Description" %
<div class="error-msg show form-error">
form.description.errors
</div>
% else %
% render_field form.description class="form-control ckeditor" placeholder="Description" %
% endif %
</div>
</div>
Question: I am not getting the POST value of description after form submit(in views.py). Any help will be appreciated. Thanks in advance.
python ckeditor modelform
- I have installed ckeditor.
- Placed "path('ckeditor/', include('ckeditor_uploader.urls'))," in urls.py
- Placed "'ckeditor'," in INTALLED_APPS in settings.py
Placed
## CKEDITOR CONFIGURATION ##
####################################
CKEDITOR_JQUERY_URL = 'https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js'
CKEDITOR_UPLOAD_PATH = 'uploads/help/'
CKEDITOR_IMAGE_BACKEND = "pillow"
CKEDITOR_CONFIGS =
'default':
'toolbar': None,
'height':100,
'width':500,
,
###################################at the end of file in settings.py
models.py :
from ckeditor.fields import RichTextField
from django.db import models
class Help(models.Model):
title = models.CharField(max_length=255)
description = RichTextField(blank=True, null=True) #models.TextField()
class Meta:
managed = False
db_table = 'help'
def __str__(self):
return self.titleforms.py
from ckeditor.widgets import CKEditorWidget
from django import forms
class HelpForm(ModelForm):
description = forms.CharField(widget=CKEditorWidget())
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
class Meta:
model = Help
exclude = ('created_by', 'updated_by', 'created', 'updated')help.html
% load i18n static widget_tweaks %
<form id="newFrm" method="post" novalidate>
% csrf_token %
form.media
<div class="col-lg-6 col-md-8 col-sm-12 col-xs-24">
<div class="form-group">
<label for="">description <span class="required">*</span></label>
% if form.title.errors %
% render_field form.description class="form-control ckeditor error" placeholder="Description" %
<div class="error-msg show form-error">
form.description.errors
</div>
% else %
% render_field form.description class="form-control ckeditor" placeholder="Description" %
% endif %
</div>
</div>
Question: I am not getting the POST value of description after form submit(in views.py). Any help will be appreciated. Thanks in advance.
python ckeditor modelform
python ckeditor modelform
asked Mar 28 at 0:26
sudhanshusudhanshu
12 bronze badges
12 bronze badges
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
I found the solution.
Please put below script in your code.
for (var i in CKEDITOR.instances)
CKEDITOR.instances[i].on('change', function()
CKEDITOR.instances[i].updateElement() );
This code will update the raw data of ckeditor in to related textarea.
Now on submit the form, you will get the data in POST.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55388442%2fhow-to-get-ckeditor-field-value-in-modelform-after-submit-in-django2-1%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I found the solution.
Please put below script in your code.
for (var i in CKEDITOR.instances)
CKEDITOR.instances[i].on('change', function()
CKEDITOR.instances[i].updateElement() );
This code will update the raw data of ckeditor in to related textarea.
Now on submit the form, you will get the data in POST.
add a comment |
I found the solution.
Please put below script in your code.
for (var i in CKEDITOR.instances)
CKEDITOR.instances[i].on('change', function()
CKEDITOR.instances[i].updateElement() );
This code will update the raw data of ckeditor in to related textarea.
Now on submit the form, you will get the data in POST.
add a comment |
I found the solution.
Please put below script in your code.
for (var i in CKEDITOR.instances)
CKEDITOR.instances[i].on('change', function()
CKEDITOR.instances[i].updateElement() );
This code will update the raw data of ckeditor in to related textarea.
Now on submit the form, you will get the data in POST.
I found the solution.
Please put below script in your code.
for (var i in CKEDITOR.instances)
CKEDITOR.instances[i].on('change', function()
CKEDITOR.instances[i].updateElement() );
This code will update the raw data of ckeditor in to related textarea.
Now on submit the form, you will get the data in POST.
answered Mar 28 at 23:57
sudhanshusudhanshu
12 bronze badges
12 bronze badges
add a comment |
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55388442%2fhow-to-get-ckeditor-field-value-in-modelform-after-submit-in-django2-1%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown