Using jQuery to Prefill and Disable Required Columns in a SharePoint Form


<script language="javascript" type="text/javascript" src="../../jQuery%20Libraries/jquery-1.4.2.min.js"></script>

2<script language="javascript" type="text/javascript">
3  $(document).ready(function() {
4    $("input[Title='Title']").val("Hello World");
5    $("input[Title='Title']").attr("disabled", "disabled");
6  });
7  
8  function PreSaveAction() {
9    $("input[Title='Title']").attr("disabled", "");
10    return true;
11  }
12</script>
 
 
********************************************************************
 
if you need to know if a specific object is visible:
if ( $('#myitem').is(':visible')){
// perform logic if the item is visible..
}

************************************************

Comments

Popular posts from this blog

SharePoint 2016 and 2019 Ports

Clear fields based on drop-down values in PowerApps

Hide a SharePoint list field based on user group using JQuery Webservice in 2010