function checkformat(inputFile)
{
    var file = $(inputFile).val();
    var allowed_extensions = new Array("jpg","png","jpeg");
    var file_extension = file.split('.').pop().toLowerCase();

    if(allowed_extensions.includes(file_extension))
    {
       $(inputFile).prev('.error2').hide('slow');
        return true;

    }
    else 
    {
       $(inputFile).prev('.error2').show('slow');
       $(inputFile).val("");
        return false;
    }
   
}
//checking file formats only jpg, png, jpeg are allowed
checking file formats only jpg, png, jpeg are allowed
checking file formats only jpg png jpeg are allowed
function checkformat(inputFile)
{
    var file = $(inputFile).val();
    var allowed_extensions = new Array("jpg","png","jpeg");
    var file_extension = file.split('.').pop().toLowerCase();
    if(allowed_extensions.includes(file_extension))
    {
       $(inputFile).prev('.error2').hide('slow');
        return true;
    }
    else 
    {
       $(inputFile).prev('.error2').show('slow');
       $(inputFile).val("");
        return false;
    }
}
function checkformat ( inputFile ) { var file = $ ( inputFile ) . val ( ) ; var allowed_extensions = new Array ( "jpg" , "png" , "jpeg" ) ; var file_extension = file . split ( '.' ) . pop ( ) . toLowerCase ( ) ; if ( allowed_extensions . includes ( file_extension ) ) { $ ( inputFile ) . prev ( '.error2' ) . hide ( 'slow' ) ; return true ; } else { $ ( inputFile ) . prev ( '.error2' ) . show ( 'slow' ) ; $ ( inputFile ) . val ( "" ) ; return false ; } }
checking file formats only jpg, png, jpeg are allowed
checking file formats only jpg png jpeg are allowed