Tuesday, August 20, 2024

How to disable Multiple line of text (jQuery) in SharePoint server 2013, 2016, 2019

Hello everyone, without further ado I am posting the code that does not work on Form (New and Edit) fields, question for the forum:
$("textarea[title='Client']").prop('disabled', true);
$("textarea[title='Client']").prop('disabled', 'disabled');
$("textarea[title='Client']").attr("disabled", "disabled");
$("div[id^='Client']").attr("readonly","true");
$("input[title='Client']").attr("readonly","true").css('background-color','#F6F6F6');
And working code:
$("div[id^='Client']").attr("contentEditable","false").css('background-color','#F6F6F6');
Look at references "contenteditable".
Happy Coding!

No comments:

Post a Comment