I have the following:
<input id="user_profile_pic" name="user[profile_pic]" type="file">
On the server I check to make sure it’s an image, but I want to check on the clientside first.
How with jQuery can I alert the user if the file input file selected isn’t a gif,jpg,png, or bmp?
Thanks
You want to check what the value of the element is, something along the lines of:
Edit
Code changed based on comment – now removes the value of the selected file if not an image.