I’m trying to post my textarea. Without the TinyMCE RichText, the form posts. However, when adding the RichText it seems the iframe removes the name from the textarea called ‘description’.
I’m aware that TinyMCE isn’t a textarea, it’s an iframe. When I submit, the ‘description’ is missing. Is there anyway to post and grab the ‘description’ data for the backend? Or am I doing something wrong?
<script language="javascript" type="text/javascript">
tinyMCE.init({
theme : "advanced",
mode : "textareas",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_buttons1 : "bold,italic,underline,bullist,numlist",
theme_advanced_buttons2 : "",
theme_advanced_buttons3 : "",
theme_advanced_buttons4 : "",
width: "100%"
});
...
<div>
<label for="id_description">Description</label>
<textarea class="required input-text full-width" id="id_description" rows="4" name="description"></textarea>
</div>
What worked before in my views.py:
description = request.POST.get('description','')
..and more stuff
Thanks for your help in advance.
Maybe you should use this package: django-tinymce, install it (django-tinymce docs)
and declare form field (for model text field) as fallow: