kirtik
kirtik

Reputation: 11

disable a hidden control in sharepoint using jquery

I have hidden a sharepoint yes/no filed using jquery. When i am logged in as another user i want to directly disable the hidden field. Somehow unless i show it first , i am not able to disable it.

This works : this field is hidden with jquery

$("nobr:contains('Extend This Contract ?')").parent('h3').parent('td').parent('tr').show(); $("input[Title='Extend This Contract ?']").attr("disabled", "disabled");

This does not

$("input[Title='Extend This Contract ?']").attr("disabled", "disabled");

Any workarounds for this ? Thanks in advance.

Upvotes: 0

Views: 119

Answers (1)

Denys Wessels
Denys Wessels

Reputation: 17039

Try using prop instead of attr:

$("input[Title='Extend This Contract ?']").prop("disabled", true);

Upvotes: 1

Related Questions