1

I've got a custom backend module. This module has a form created with xml and .phtml file. In form there's some inputs, selects and textarea (the problem). In .phtml file there's only buttons which work as "input buttons". When user clicks on the button a custom text is inserted into a textarea (via JS). Problem is whenever I click one of the buttons and DO NOT do anything in the textarea (add letter, remove space etc.) then the inserted text via JS is NOT in POST data.

Example:

Textarea: "some text and now {{TEXT_INSERTED_VIA_JS}}"
POST: "some text and now "

Textarea: "some text and now {{TEXT_INSERTED_VIA_JS}} {{TEXT_INSERTED_VIA_JS}} {{TEXT_INSERTED_VIA_JS}}"
POST: "some text and now "

Textarea: "some text and now {{TEXT_INSERTED_VIA_JS}} {{TEXT_INSERTED_VIA_JS}} some text {{TEXT_INSERTED_VIA_JS}}"
POST: "some text and now {{TEXT_INSERTED_VIA_JS}} {{TEXT_INSERTED_VIA_JS}} some text "

Textarea: "some text and now {{TEXT_INSERTED_VIA_JS}} some more text"
POST: "some text and now {{TEXT_INSERTED_VIA_JS}} some more text"

Textarea: "some text and now {{TEXT_INSERTED_VIA_JS}} *I remove space here via keyboard*"
POST: "some text and now {{TEXT_INSERTED_VIA_JS}}"

Point is when I click a button (enter text via JS into textarea) and there's no activity in textarea via keyboard, then the text inserted via JS is gone in POST.

Any ideas why?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.