Topic: Cannot get data from mdbWYSIWYG plugin or customize the functionality of the upload image button
Ruben Chevez pro asked 4 years ago
*Expected behavior*I expected to be able to edit the content from inside the which the mdbWYSIWYG plugin works using jquery $("#textarea-container").html(content) or $("#textarea-container").val(content) . Also, the image button only allows to include link to images, I expected to be able to upload images.
*Actual behavior*Cannot get/set data from/to mdbWYSIWYG plugin using jquery or customize the functionality of the upload image button. I need to upload data when clicking the image button.
Resources (screenshots, code snippets, etc.)$("#post_description").mdbWYSIWYG();
The following code snippets do not work.
let content = $("#container").html();
let content = $("#container").val();
You can set WYSIWYG content before initializing it using JS. Your code should look like this:
Of course, you can set it using HTML too, just put your HTML code between
You can check effects here: https://mdbootstrap.com/snippets/jquery/krzysztof-wilk/2362676#html-tab-view
But for now, I'm afraid you can't set content after initializing a WYSIWYG Editor, you have to do it before.
Hi, @Ruben Chevez!
I've just initialized my WYSIWYG like this:
And then, I was able to get its content:
Everything looks like it works fine. What's the issue you're facing?
About the image upload, currently, it's not possible. I hope this will be added soon
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
- User: Pro
- Premium support: No
- Technology: MDB jQuery
- MDB Version: 4.8.0
- Device: Desktop
- Browser: Chrome
- OS: Windows
- Provided sample code: No
- Provided link: No