You don't need to send the value of div-sharpeditor to input-sharpcontent to make ajax catch data and send it to php for processing.

I use the quill editor
he is editing text in the DIV area

<div id="editor" class="ql-editor"></div>
<input type="hidden" name="content" id="content">

ajax

$("-sharpform").submit(function(e){ 
// ...

var formData = new FormData($("-sharpform")[0]);

formData.append("content", document.querySelector(".ql-editor").innerHTML);

        $.ajax({
            type:"POST",
            url:"xxx.php,
            data: formData,
            enctype: "multipart/form-data",
            cache: false,
            contentType: false,
            processData: false,
            success:function(data){
                //...
            }
        });

I will first send the contents of ql-editor to content
in the list, and then process
to php, but now there is a problem because quill uploads content using base64
, so I make an error when I upload content to input value
because there is an attachment method of
, so there is no way to directly use
to use
on input"s value profile. How can I solve this problem?

In short,
how can I get ajax to catch data and send it to php for processing without having to send div-sharpeditor value to input-sharpcontent?


Why not consider separating the string from base64 so that it can be put into input?


I haven't used this editor, but in theory, you don't have to put the content in input. Adding a name attribute to-sharpeditor should get the form content normally

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b312b9-2bd64.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b312b9-2bd64.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?