Solution 1 :

The textarea does not have a name attribute, this is required for POST requests. the id attribute is primarily for JavaScript.

Try this for your textarea:

<textarea id="w3review" name="w3review"></textarea>

Problem :

I am using pure JS to add options to a textarea, namely using SunEditor.

The JS is rendered in the front-end’s textarea tag, but the input/content created is not being saved/POSTed to the the server via the form’s POST request.

Can someone please point me where am I going wrong?

<textarea id="w3review" name="w3review"></textarea>
    const editor = SUNEDITOR.create('w3review', {
        font: ['Arial'],
        buttonList: [['font', 'fontSize']],
        callBackSave: function(contents) {}

    const contents = editor.getContents();


Comment posted by Ali Hamdan

Hi thanks for your answer, I do have a name attributeI am using a page builder and it’s inputted in the UI so I forgot to add it here,( edited now). I think there is a problem with JS forwading the input upon form submission.

Comment posted by Skully

Can you provide the code of the POST request being sent, and the PHP code that is receiving it?


Leave a Reply

Your email address will not be published. Required fields are marked *