Changing text on submit button on comment form

Peter Eichhorst asked on March 28, 2017 06:54

I am trying to figure out how to change the text on the submit button from "Add" to "Submit". I found the code in CMSModules\Blogs\Controls\BlogCommentEdit.ascx where the submit button is, but I do not know how to change this text.

Recent Answers


Dawid Jachnik answered on March 28, 2017 08:05

Hello, You can achive this by changing the resource string key "general.add", because this button is using that key. Or you can do the custom in file "\CMS\CMSModules\Blogs\Controls\BlogCommentEdit.ascx.cs" and search for "btnOk.Text"

1 votesVote for this answer Mark as a Correct answer

vasu yerramsetti answered on March 28, 2017 14:19 (last edited on March 28, 2017 14:20)

You can handle this in code behind file like below. Please comment GetString("general.add") statement and replace with your string i.e "Submit".

protected void Page_Load(object sender, EventArgs e)
    {
        mOkButtonText = "Submit";//GetString("general.add");
        mCommentSavedText = GetString("Blog.CommentEdit.CommentSaved");

        // Basic control initialization
        lblName.Text = GetString("Blog.CommentEdit.lblName");
        lblUrl.Text = GetString("Blog.CommentEdit.lblUrl");
        lblComments.Text = GetString("Blog.CommentEdit.lblComments");
        btnOk.Text = mOkButtonText;
        }
0 votesVote for this answer Mark as a Correct answer

Laura Frese answered on March 28, 2017 23:35

alternatively you can hack it with jquery if you need a quick fix and cant access the files on the server.

$(".buttonclass").text("Submit")

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.