- You usually want
prop() rather than
- In the majority of cases, prop() does what
attr() used to do. Replacing calls to
prop() in your code will generally work.
- Properties are generally simpler to deal with than attributes. An attribute value may only be a string whereas a property can be of any type. For example, the checked property is a Boolean, the style property is an object with individual properties for each style, the size property is a number.
And According to Disable/enable an input with jQuery,
For jQuery 1.6+, To change the
disabled property you should use the
So, you can try using your code like below:
/*'textarea...' for multiple line text works */
$("input[Title^='Release Info']").prop("disabled", true);
$("input[Title^='Release Date']").prop("disabled", true);
I have used Starts With(
^=) Selector which makes your element selection successful in some cases where your field is Required as in SharePoint it automatically adds
Required Field to the
title attribute of your field.
If you have a single line of text field with display name
Release Info and this field is Required then its
title property will be like
Release Info Required Field. In such cases
$("input[Title='Release Info']") selector fails.
Reference: Attribute Starts With Selector.
Additional Reference: Difference between