W
W
wixtransfer2017-09-22 14:23:24
Blogs
wixtransfer, 2017-09-22 14:23:24

How to add a name to the comment box?

How can I make it so that after clicking the "reply to comment" button, a field for entering a comment appears under the comment with the name of the user whose comment is being answered?

Thank you in advance!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Pavel Kornilov, 2017-09-22
@KorniloFF

Dynamically create textarea on click. After that, enter the name
textarea.textContent = userName into it with a script.
userName is taken from the corresponding DOM node. There is no more specific answer to the question.

E
Egor Zhivagin, 2017-09-22
@Krasnodar_etc

Well... you make up input fields. By clicking on "reply" you are looking for the username in this block.
General outline:

var name = $('this').parents('.comment').find('.commenter_name');

Paste the name where you need it. You show it and the input field.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question