Photo by ODISSEI / Unsplash

Change “Specify your own value” text on SharePoint list and survey choice columns

SharePoint 2010 Feb 19, 2015

It is possible to change the default value of a choice column, “Allow ‘Fill-in’ choices”, in SharePoint 2010 using a content editor web part and some code.

The steps vary slightly depending on whether it is for a survey form or for a regular list form.

Specify your own value

 

To change the value in a regular list form

1. Navigate to the list that contains the choice column to be adjusted. Make sure that the choice column  already exists and has the “'Allow Fill-in’ choices” option checked in its settings.

Specify your own value

2. From within the list ribbon, select the List Tools > List menu tab. Then select the “Form Web Parts” button, which will display 3 options. Both “Default New Form” and “Default Edit Form” will need to be changed. Start with the “Default New Form” option.

Specify your own value

3. The edit screen for the NewForm.aspx page will open. The choice field that will be edited should be displayed somewhere on the page. Copy the label for the “Specify your own value” choice in the column by viewing the page html source code in your browser. For Internet Explorer, right click the page and select “View source”. Search for “Specify your own value” in the source and it should find the values for that choice option. Find the <label > tag and copy everything within the double quotes and paste it to Notepad for later. It will start with something like “ct100_m_g_…..”. The source screen can now be minimized.

4. Return to the Edit Page mode for the New Form. Add a Content Editor web part to the bottom of the form. Click inside the web part to add values and then from within the Ribbon > Editing Tools > Format Text tab click on the HTML button > Edit HTML Source.

5. Copy and past the following into the HTML editing box. Replace the “REPLACE THIS TEXT WITH COPIED LABEL” with the Label copied in step 3 and make sure it is still surrounded by single quotes. Adjust the text “Please enter your own value” to what you would like the field to dispay. Click OK when finished.

<script src=“http://code.jquery.com/jquery-latest.js” type=“text/javascript”></script><script type=“text/javascript”>
$(document).ready(function(){
$(“label[for='REPLACE THIS TEXT WITH COPIED LABEL’]”).text(“Please enter your own value”);
});</script>

6. Stop editing the page by clicking on the Page tab > Stop Editing to return to the list screen. Bring up the new form by adding a new item and the custom text should now appear instead of the default text.

Specify your own value

7. To adjust the Edit Form text, repeat steps 2 - 5 and select “Default Edit Form” in step 2.

To adjust form on a Survey input form

1. The form link will first need to be obtained. Make sure the fields that will be adjusted have been created and navigate to the Survey Overview page. Click on the “Respond to this Survey” link, which will bring up the survey “New form”. Right-click the form and select Properties, which will display the Address (URL) field to access the form directly. Copy the Address value and cancel out of the properties. Cancel out of the New form survey entry as well.

2. Paste the copied URL into the browser’s address bar and remove the ?IsDlg=1 at the end of the link to navigate to the new form page. This will bring up an editable “New Form” for the survey.

3. Steps 3-5 can now be performed from the Editing List form instructions above.

4. If your survey has logic built in, then the “edit form” will need to be adjusted. The “edit form” link can be reached by using the same link copied in step 1 and changing the NewForm.aspx at the end to EditForm.aspx

Please let me know your thoughts and if you have found other ways to make these changes.

Tags