Disable multine field with Jquery in Sharepoint

Asked

Viewed 32 times

1

I am performing a Jquery script to disable certain fields of a page in Sharepoint, the fields of a row I have identified of a line are inputs and the multilines seem to be Divs.

inserir a descrição da imagem aqui

Note that the input of a line is disabled with the code I did, but the below which is multiline I can perform editing and do not want this.

 inserir a descrição da imagem aqui

I inspected the field and it returned me the html code above, so I made the following script to try to disable:

jQuery(document).ready(function() {
    $("div[id='o id da div']").attr("readonly","true").css('background-color','#CDC5BF');
       $("select[id='id da div']").attr("disabled", "disabled");
}

It’s not working yet...

Can you help me in this? I thank you in advance.

  • 1

    Hello @V. Medeiros your question is inconsistent, DIV are read-only elements, it makes no sense to "disable them" there should be an element within the div shown in the print a TEXTAREA this you must manipulate in your Javascript code

1 answer

0

Thanks Vinicius for the touch, I’m still beginner!

I analyzed the code and tried to manipulate the element and still unsuccessful.

inserir a descrição da imagem aqui

jQuery(document).ready(function() {
    $("textarea[id='id do textarea']").attr("readonly","true").css('background-color','#D3D3D3');
           $("select[id='id do text area']").attr("disabled", "disabled");
}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.