Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to validate file type in jquery

var ext = $('#my_file_field').val().split('.').pop().toLowerCase();
if($.inArray(ext, ['gif','png','jpg','jpeg']) == -1) {
    alert('invalid extension!');
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript credit card validation 
Javascript :: delay input javascript 
Javascript :: rror: btoa is not defined 
Javascript :: toast angular 
Javascript :: consoleLine 
Javascript :: center element in react native 
Javascript :: html form post json example 
Javascript :: jquery ajax responsetext 
Javascript :: disable key enter react-hook-form 
Javascript :: react native run ios release 
Javascript :: assign class to element javascript 
Javascript :: chrome storage onchanged 
Javascript :: get dir from filepath javascript 
Javascript :: axios try catch 
Javascript :: iso to date javascript 
Javascript :: jquery boilerplate 
Javascript :: remove comma from number javascript 
Javascript :: isInt js 
Javascript :: how to launch several async functions in node js 
Javascript :: get name of class javascript 
Javascript :: js sort by date 
Javascript :: javascript shuffle string 
Javascript :: js loop array in array 
Javascript :: how to check if a javascript object is empty 
Javascript :: nodejs javascript heap out of memory 
Javascript :: js get value of input 
Javascript :: chalk nodeks 
Javascript :: jquery onload function for div 
Javascript :: Regular Expression for Detect Iranian Mobile Phone Numbers | IR mobile number Regex Pattern 
Javascript :: sum elements in list with same name js 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =