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)

Adding Navigation Links To Quick Launch Bar Programatically (SharePoint 2010)

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