Sunday, January 12, 2014

Disable Control in default Add/Edit List form

We might have came across situation where we need to disabled controls on add/edit form based on user selection or for that matter based on any condition/requirement.

Add Content Editor Webpart below the NewForm/EditForm, then include the Javascript in source editor of Content Editor Webpart

<script language="javascript">
$("input[title='title of the input control']").attr("readonly","true"); 
</script>


Note - Make sure jquery libraries is referenced in master page or else call it content editor webpart itself

Hope this helps...Happy Coding!!!!

No comments:

Post a Comment