- This of course would add a bit of overhead for every single page that uses the master page!
- Editing the ows.js file and editing the string
- Which works fine until the next update or patch and the ows.js file is overwritten, also never ever modify out of box .js!
- Using JQuery to find the exact field attribute (by name) and changing the text
- Really? I need JQuery to do something simple like this?
I saw a couple other methods of achieving these results, all of them very bad, most of which made me cringe because it either went against my core belief that you never modify out of box code, you never add global functionality for specific items, or it goes against the lazy bone that believes everything should just be a simple cut and paste function without customization, if I can’t drop the functionality in as a web part then damn it I should be able to! So I looked for a better way, surprisingly nobody seemed to hit upon this method, which utilizes our handy and ever trusty Content Editor Web Part…
- Open the site in SharePoint Designer 2010
- Go to the Lists and Libraries, and select the Survey you want to edit from the content window:
- Click on the “NewForm.aspx” file in your main content window:
- Now add a Content Editor Web Part right below the standard ListFormWebPart, like so…
Now, as for the content, it gets a bit tricky, you’ll want to go down to where the <Content> tag is for your Content Editor Web Part and add the following code between the brackets in the CDATA
EDIT: As you may see from the comments, I forgot about FireFox, so for those of you who like cut and paste, use the script below instead in order to work with FireFox as well by replacing the “innerText” with “innerHTML”
It should look like the following on your screen:
- Ok, save the NewForm.aspx page and you’re done. Now when a user goes to take the survey, the ugly “Specify your own value:” is replaced with a nice friendly “Other:”
- Even better, because we used SharePoint web parts to achieve this, we only experience overhead on this specific page, we didn’t have to edit out of box code, and because we stayed within the normal confines of editing the NewForm.aspx it means our file doesn’t get UnGhosted! Winner!