Is it possible to change Related Items view "Add New Item" link text?

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
eedoh
Posts: 37
Joined: Tue Feb 11, 2014

24 Feb 2014

I'd like to change "Add new item" link text in Related Items view into something else, but can't find the way of doing that. Is it possible, and if yes, how can I do that??

Thanks

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

25 Feb 2014

Please, put the following code into JS-editor of Forms Designer:

Code: Select all

$('.ms-addnew a, .ms-list-addnew span:eq(1)').html('New text');
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function() {
    $('.ms-addnew a, .ms-list-addnew span:eq(1)').html('New text');
});
Replace 'New text' with your own text of the new item link.

eedoh
Posts: 37
Joined: Tue Feb 11, 2014

25 Feb 2014

This really does change the text, but it changes it in every one (4 of them) of the related items views, and I need it to be changed only on one of them. Any way of restricting this to only one view??

Thanks

eedoh
Posts: 37
Joined: Tue Feb 11, 2014

25 Feb 2015

I figured it out. Needed to add .eq(number) to it

Code: Select all

$('.ms-addnew a, .ms-list-addnew span:eq(1)').eq(0).html('New text');
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function() {
    $('.ms-addnew a, .ms-list-addnew span:eq(1)').eq(0).html('New text');
});

Murray
Posts: 3
Joined: Sun Feb 16, 2014

29 May 2015

Are you able to apply this to the default "Tthere are no items to show in this view...." would it be something like this? $('.ms-listviewtable table td.ms-vb:contains('There are no items'):eq(1)').eq(0).html('Replace'); Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function() { $('.ms-listviewtable table td.ms-vb:contains('There are no items'):eq(1)').eq(0).html('Replace'); }); This doesn't work but imagine it would be similar to the Add New Item Thanks Murray

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 20 guests