This project has moved and is read-only. For the latest updates, please go here.

MakeReadOnly truncates field values if finds any special characters like '&'

Oct 29, 2015 at 9:31 PM
Edited Oct 29, 2015 at 9:34 PM
This utility is really really great and saves life.. Found only one minor issues with what I have used so far. I am making a single line text field read only using the below function call, and if finds a special character like "&" in the value it truncates the string beyond & and display only characters before &.

Example -
CustomerCode = "R&DI"
When form is displayed is only displays R and not R&DI

Tried debugging the sputility's code with no luck, any help or direction you could provide? Thanks in advance.
Nov 1, 2015 at 11:46 PM
Edited Nov 1, 2015 at 11:47 PM
Thanks, glad to hear you've found it useful.

I tried this in SharePoint 2013 using Chrome and it worked OK. Can you describe the environment you are working in?

If you try running this does it work?
Nov 3, 2015 at 9:24 PM
Aah!! I see.. appears it displays the value in read-only field just correct in in Chrome, doesn't works in IE 11, it gets truncated for some reason. Have to find a solution for IE.

However the values like ''R&D'' are stored in a list and are supposed to be read only, so could not set on the fly.
Nov 4, 2015 at 3:56 PM
I am still unable to reproduce this (IE 11 + SharePoint 2013) but the value must need to be HTML encoded. I could make that change and then have you test to see if it works for you?
Nov 4, 2015 at 7:55 PM
I made a small change to SPUtility.js and uploaded them here:

Can you try it out and let me know if this solves your issue?