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

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

How to copy DLLs from GAC.