This project has moved. For the latest updates, please go here.

Renaming field names clientside

Nov 25, 2014 at 3:11 PM

I'm working in SP2010.

What I'm trying to do should be simple, yet I haven't figured out a way to make it work. I have a document library with some column names that I want to keep intact, however in the Edit form I want to change the text of the field to show something else which should be completely client side.

For example, the column is titled "Test" but in the edit form, for that field value I want the title next to it to say "Step 1: Test". Is this doable with SPServices or even regular JQuery? On a regular HTML page I can make it work no problem, however in SP it doesn't so there must be a trick to it.

If I view the element, the field title doesn't have anything attributed to it, it's simply wrapped in <nobr></nobr>

Nov 25, 2014 at 4:37 PM
This isn't an SPServices issue but a fairly straight forward jQuery issue. I gather you just want to change the label for the field, correct? Assuming the data element is a basic input field, the following works for me.

$(document).ready(function() {
$("input[title='Test']").closest("td").prev().children("h3").first().text("Step 1: Test");

Nov 25, 2014 at 4:45 PM

That did it, I wasn't looking at it from that perspective. Works like a charm and thanks!