Tuesday, August 13, 2013

Add Custom Attachment Control & Disable Attachment button on Ribbon

<!-- Add Attachment File control -->

<table width="100%">
<tbody><tr>
<td width="190" class="ms-formlabel" valign="top" style="font-family: verdana; color: #525252; font-size: 1em; font-weight: normal">Add Attachments: </td>
<td class="ms-formbody" id="attachmentsOnClient" valign="bottom">
<span dir="ltr">
<input name="fileupload0" title="Name  " class="ms-fileinput" id="onetidIOFile" type="file" style="width: 386px"/> </span>
</td></tr>
<tr><td>&#160;</td>
<td class="ms-attachUploadButtons">
<input id="attachOKbutton" onclick="OkAttach()" type="button" value="OK  " style="width: 5.8em; height: 1.8em"/> <span id="idSpace"></span></td>

</tr></tbody></table>
 

<!-- Hide File Attachment Button on Ribbon-->

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js">
</script><script type="text/javascript">
$("span.ms-cui-ctl-largelabel:contains('Attach')").parent("a").hide();

$("span.ms-cui-groupTitle:contains('Actions')").hide();
 </script><!-- Hide File Attachment Button -->

Use in list forms & Enjoy :) 

How to launch a document by clicking a link to the file?

Word: <a href='ms-word:ofe|u|path/to/web/word/document.docx'>Link to document</a> Excel: <a href='ms-excel:o...