SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Addict
    Join Date
    Nov 2009
    Posts
    311
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Checking file upload with jQuery

    Hi,

    I have a file upload field on my form and I am trying to check whether it is empty or not. The following code works

    Code:
    if (document.getElementById('logo').value == '') {
    but the following does not

    Code:
    if ($('#logo').val() == '') {
    Am I missing something?

    EDIT: I forgot to include jQuery file It works now.

  2. #2
    SitePoint Addict bronze trophy
    Join Date
    Sep 2005
    Posts
    323
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Try:

    Code:
    if ($('#logo').val() == null) {


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •