Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

99
Views
Using the WYSIWYG MDBootstrap widget

I am trying to use the MDBootstrap WYSIWYG plug-in to enhance my forms, but am coming up short.

It does not seem to appear to be a class that can be applied to a textarea; doing so only displays the form element without the enhanced functions and toolbar. Instead, the docs say to create an instance as follows

<div class="wysiwyg" data-mdb-wysiwyg="wysiwyg" id="foo" name="foo">

However, when submitting a form that includes the above div, the value contained is not "posted" or "getted".

I have seen a post (https://mdbootstrap.com/snippets/standard/m-duszak/3256156#js-tab-view) that suggests what to do, using Javascript, but I don't understand it. The HTML they give (with the addition of the first textarea that I have added) is:

<form>
   Title:
   <textarea name="title" cols="60" rows="2"><?php echo $Story->title; ?></textarea>

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

  <button type="submit" class="btn btn-primary">
    Submit
  </button>
</form>

The JS is:

const formEl = document.querySelector('form');
const firstArea = document.querySelector('.first-area .wysiwyg-content');
formEl.addEventListener('submit', (e) => {
  e.preventDefault();
  alert(`Text area content: ${firstArea.innerText}, but you can also get HTML: ${firstArea.innerHTML}`)
})

What I need to do is get what is there into a $_POST or $_GET or via some method that I can then use to process for a MYSQL insert or update. Any help would be appreciated.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!