Validation for Asp FileUpload Control using JavaScript

function validatefileuploadcontrol()
        {       
        
            $( $('input[id*="FileUpload1"]')).change(function() {
                var fileExtension = ['doc', 'docx']; //Extensions
                if ($.inArray($(this).val().split('.').pop().toLowerCase(), fileExtension) == -1) {                
                    alert("'.doc', '.docx' formats are allowed.");
                }
            })
        }

Comments

Popular posts from this blog

javascript to get the all site user in sharepoint 2010 (Getting all Site users using Client Object Model)

SharePoint 2010: JavaScript Code To Check if user exists in a group (ECMA)

Disable all day event, Recurrence,Workspace Fields in Calendar list