Disable Form Field by using jQuery

Problem Description:

Usually you disable fields on forms by using SP Designer.
But if it’s a site content type, you can’t do it this way –> use a piece of Javascript

Resolution:

1. Download a jqueryxx.min.js file and place it in e.g. Site Assets library.

2. On the list settings choose the form web part you want to manipulate.
Then add a script web part and add following code (the correct title of the field you may find by inspect the element in the browser).

<script src=”http://PathToYourjQueryFile/jquery-xx.min.js” type=”text/javascript”></script>
<script type=”text/javascript”>
$(document).ready(function()
{
$(“input[Title=’YourFieldTitle’]”).attr(“disabled”, “disabled”);
});
</script>

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...