Enable / Diable controls in Sharepoint Newform.aspx or Editform.aspx or where ever inside sharepoint

This is pretty easiery way for you to enable and disable controls in sharepoint lists pages or where ever you need it.
better off is tat to find the ID of the control using the view source and just execute this in javascript
Thats it .. its all set

The id will look something like this
ctl00_m_g_6e363f12_79be_43ef_a4e9_3967baee41bd_ctl00_ctl04_ctl12_ctl00_ctl00_ctl04_ctl00_ctl00_DateTimeField_DateTimeFieldDate

so your code is gonna be this way
document.aspnetForm. ctl00_m_g_6e363f12_79be_43ef_a4e9_3967baee41bd_ctl00_ctl04_ctl12_ctl00_ctl00_ctl04_ctl00_ctl00_DateTimeField_DateTimeFieldDate.disabled=”True”;
or
document.aspnetForm. ctl00_m_g_6e363f12_79be_43ef_a4e9_3967baee41bd_ctl00_ctl04_ctl12_ctl00_ctl00_ctl04_ctl00_ctl00_DateTimeField_DateTimeFieldDate.disabled=true;

Open up the page in sharepoint designer and find for the code below

and then add the javascript given above and it will work.

Leave a Reply

Your email address will not be published. Required fields are marked *

Bitnami