Posts

Showing posts with the label filename

SharePoint - Check File Name in Upload form in Document Library with Javascript

Image
If you want to check file name of new document in Upload form, you can do with Javascript! I created a custom js that check filename then disables button OK if condition is not verified. I override the function CheckAssetLibMediaExtension on event "onchange" of input file control in Upload.aspx. If you see HTML Source of Upload.aspx (rendered by browser) you see: <input name="ctl00$PlaceHolderMain$UploadDocumentSection$ctl05$InputFile" type="file" id="ctl00_PlaceHolderMain_UploadDocumentSection_ctl05_InputFile" class="ms-fileinput ms-fullWidth" size="35" onfocus="ResetSpFormOnSubmitCalled();" onchange="CheckAssetLibMediaExtension()" title="Scegliere un file" /> Search for function in HTML Source, you find: function CheckAssetLibMediaExtension() { } So, you can override it! Create in masterpage reference to jQuery and add function below : function CheckAssetLibMediaEx...