Closing out this question for now; there is no ready answer and the issue is not a show-stopper at this point.
SharePoint 2013 edit form - read-only choice field reverting to first item on save
I have a custom edit form for a SharePoint 2013 list; it contains JS code that sets all but two of the fields to readonly. When the form is opened and saved, the existing values for all of the choice fields change to the first item in each choice list, which was not intended.
Here's my JS code if you're interested:
$(document).ready(function() {
jQuery("input[title^='Server Name']").prop("readonly", true);
jQuery("select[title^='Server Type']").attr("disabled","true").css('color','#000000');
jQuery("select[title^='Site']").attr("disabled","true").css('color','#000000');
jQuery("select[title^='Operating System']").attr("disabled","true").css('color','#000000');
jQuery("select[title^='Replace Existing Server']").attr("disabled","true").css('color','#000000');
jQuery("input[title^='Current Server Name']").prop("readonly", true);
jQuery("select[title^='File Server']").attr("disabled","true").css('color','#000000');
jQuery("select[title^='Print Server']").attr("disabled","true").css('color','#000000');
jQuery("select[title^='VPN Required']").attr("disabled","true").css('color','#000000');
jQuery("select[title^='Pre-Build Status']").attr("disabled","true").css('color','#000000');
});
My google-fu is failing me today - I just can't find a solution. Help!
1 additional answer
Sort by: Most helpful
-
RaytheonXie_MSFT 39,521 Reputation points Microsoft External Staff
Jul 28, 2021, 7:47 AM Hi @Phillips, Keith ,
Per my test, I found that the script runs well.
I edit the item which title is 1234
I get following form,and the choice column is not the first item in its list
After saving the data doesn't change too.
We might need more details to test the exception.
If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.