Holiday Notice: Support will be provided on a limited scale from December 24th, 2024, to January 2nd, 2025. Happy holidays and a wonderful New Year!


Topic: WYSIWYG plugin with form

efilippi priority asked 3 years ago


Hello,

I use the WYSIWYG editor.

How can I have 2 WYSIWYG text areas in a form that will use standard POST submission (no ajax) ?

It seems that there's no way to distinguish the 2 textareas, no id and no name are generated by the plugin, so the POST sends an empty value

here is the $_POST I get ([vide] => vide for the textarea genberated by the wysiwyg editor) :

Array
(
    [eljFormId] => professeurs_fr
    [vide] => vide
    [eljx_check_group] => 
    [eljx_check_group_301] => 301
    [eljx_check_group_321] => 321
    [Objet] => l'objet d'eric
    [Envoyer_Id] => Envoyer
    [Envoyer] => Envoyer
)

please help me with the way to do so.

Thanks,

Eric


efilippi priority answered 3 years ago


Hello,

thank you, this helps me.

But the pluging built texarea still as no name. So I need to add another texarea with a name attribute and copy the value in it, just like this : https://mdbootstrap.com/snippets/standard/efilippi/3088996

This results in 2 textareas for the same use.

I think an easy way to be fully compatible with forms would be to modify the plugin adding a name attribute to the wysiwyg div, and let the plugin build its textarea with the same name, so it would pass the data correctly during form submit

<div class="first-area">
    <div class="wysiwyg" name="first-area" data-mdb-wysiwyg="wysiwyg">
    </div>
</div>

html result after pluging run would be (suggestion) :

<div class="first-area">
    <textarea class="wysiwyg-textarea" name="first-area" ></textarea>
    <div class="wysiwyg" name="first-area" data-mdb-wysiwyg="wysiwyg" data-mdb-uuid="430a350c-311e-4d65-a8ae-a1338d519b5e"><div class="wysiwyg-toolbar btn-toolbar " style="top: 0px" role="toolbar" aria-label="Toolbar with button groups">
    <div class="wysiwyg-toolbar-group"> [...] </div>
    </div><div class="wysiwyg-content" contenteditable="true"></div></div>
</div>

This could be suggested to the dev team

Eric


Dawid Wajszczuk staff answered 3 years ago


Hi,

I have added this to our ideas list and maybe we will add this functionality.

Keep coding,
Dawid


Michał Duszak staff answered 3 years ago


Hello, WYSIWYG editor is not a part of Forms, but you can build a custom form. To distinguish one editor from another, wrap one into a parent, e.g.:

<div class="first-area">
    <div class="wysiwyg" data-mdb-wysiwyg="wysiwyg">
    </div>
 </div>

Then you can use '.first-area .wysiwyg-content' selector to build a custom form. https://mdbootstrap.com/snippets/standard/m-duszak/3068205#html-tab-view



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Priority
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 3.4.0
  • Device: laptop
  • Browser: firefox
  • OS: Debian
  • Provided sample code: No
  • Provided link: No
Tags