Tuesday, March 25, 2014

JavaScript Function to manage AutoGrow in HTML TextArea

I've found this very simple and usefull jscript you can use to AutoGrow based on user input.


Add this script to head of your page (no jquery is required - just simple javascript).


<script type="text/javascript" language="javascript">
function resizeTextArea(ta) {
  cr = ta.value.split('\n');
  b = 1;
  for (x=0;x < cr.length; x++) {
   if (cr[x].length >= t.cols)
    b+= Math.floor(cr[x].length/t.cols);
  }
  b+= cr.length;
  if (b > ta.rows) ta.rows = b;
 }

</script>


Then add the handler for onKeyUp event on your textarea in this way.


onkeyup="resizeTextArea(this);"

Tuesday, March 11, 2014

Some farm products and patches were not detected on this or other servers - SharePoint Patching

If you install a SharePoint patch on all server in your farm and, after executing "SharePoint Configuration Wizard", you receive an error like this:


"Error: Some farm products and patches were not detected on this or other servers. If products or patches are missing locally, you must quit this program and install the required products and patches on this server before starting this wizard. If products or patches are missing on your servers, you must install the required products and patches on the specific servers, and you may then click the Refresh button to perform the status check again."


what you need is to refresh products patch installed on the server.


To achieve this, execute this simple PowerShell command (from SharePoint Management Shell):


Get-SPProduct –local


Now you can click on refresh inside Configuration Wizard and see that the error is disappeared.