jQuery: Simple Validate of a File Upload Field Programming 08 JUL 2009


How do I validate if a user has selected a file to upload before submitting my upload form?


Simply check that it’s value contains something. In other words check:

//or else in plain vanilla javascript check:

Useful to remember.

jquery logo

Related Posts:

About Craig Lotter

South African software architect and developer at Touchwork. Husband to a cupcake baker and father to two little girls. I don't have time for myself any more.