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