title: JQuery Randomly Stops Working ( .size() )
body: <p>So I made a form and I am trying to validate it with javascript before it is processed. Every other field works perfectly fine. This is how the form looks.</p>
  
  <pre><code>&lt;form name="game_sub" action="add_game.php" onsubmit="return gameVal()" method="post"&gt;
          &lt;table&gt;
  
              &lt;tr&gt;&lt;td&gt;&lt;input type="text" name="name" class="game_name" placeholder="NAME" /&gt;&lt;/td&gt;&lt;/tr&gt;
              &lt;tr&gt;&lt;td&gt;
              &lt;select name="keyword" &gt;
                  &lt;option value="action"&gt;Action&lt;/option&gt;
                  &lt;option value="platform"&gt;Platform&lt;/option&gt;
                  &lt;option value="sport"&gt;Sport&lt;/option&gt;
                  &lt;option value="shooter"&gt;Shooter&lt;/option&gt;
              &lt;/select&gt;
              &lt;/td&gt;&lt;/tr&gt;
              &lt;tr&gt;&lt;td&gt;&lt;label&gt;Game: &lt;/label&gt;&lt;input type="file" name="game_file" id="g_file"&gt;&lt;/td&gt;&lt;/tr&gt;
              &lt;tr&gt;&lt;td&gt;&lt;label&gt;Thumbnail: &lt;/label&gt;&lt;input type="file" name="game_thumb" id="t_file"&gt;&lt;/td&gt;&lt;/tr&gt;
              &lt;tr&gt;&lt;td&gt;&lt;textarea name="desc" placeholder="DESCRIPTION"&gt;&lt;/textarea&gt;&lt;/td&gt;&lt;/tr&gt;
          &lt;/table&gt;
          &lt;a href="index.php"&gt;&lt;button type="button" id="add_btn_lft" class="add_btn"&gt;CANCEL&lt;/button&gt;&lt;/a&gt;
          &lt;input type="submit" value="SUBMIT" id="add_btn_rgt" class="add_btn"/&gt;
  </code></pre>
  
  <p>Then I add the javascript. The javascript has 1 little line of jQuery within it by which I already added the google jquery source script to the top of the page. It worked for like 1 hour perfectly, I left, and came back and it's broken. I checked what was wrong with it by turning some of my lines into comments to see if its absence would make it work again. I did and when I removed the variable:</p>
  
  <pre><code>var TSize = document.forms.game_sub.game_thumb.form[0].size;
  </code></pre>
  
  <p>The whole script came back to life. I was using the .size from jQuery to acquire the size of the file in bites and it was working for a while but I have no idea what happened ... It just randomly decided not to work. Is there a problem with javascript executing jQuery within it? I've done it before and had no problem but this is odd.</p>
  
  <p>This is how my .js file looks:</p>
  
  <pre><code>function gameVal() {
  
    var GName = document.forms.game_sub.name.value;
    var GCat = document.forms.game_sub.keyword.value;
    var GFile = document.forms.game_sub.game_file.value;
    var GThumb = document.forms.game_sub.game_thumb.value;
    var Tarea = document.forms.game_sub.desc.value;
    var BErr = document.getElementById("add_game_err");
    var GFile2 = GFile.split(".");
    var GThumb2 = GThumb.split(".");
    var imgExt = ["jpg", "jiff", "jpeg", "gif", "tiff"];
    var gameExt = ["swf", "unity3d"];
  
    if (window.File &amp;&amp; window.FileReader &amp;&amp; window.FileList &amp;&amp; window.Blob) {
  
    if (GFile == "" || GThumb == "" || GName == "" || GName == null || GCat == "Category" || Tarea == "") {
      BErr.style.display = "block";
      BErr.innerHTML = "Please fill in all the fields.";
      return false;
    }
    else if (GFile2.length &gt; 2) {
      BErr.style.display = "block";
      BErr.innerHTML = "Please make sure the game file name has no periods(.) within it.";
      return false;
    }
    else if (GThumb2.length &gt; 2) {
      BErr.style.display = "block";
      BErr.innerHTML = "Please make sure the thumbnail file name has no periods(.) within it.";
      return false;
    }
    else if (imgExt.indexOf(GThumb2[1]) == -1) {
      BErr.style.display = "block";
      BErr.innerHTML = "Thumbnail file format is invalid. (Only JPG, JIFF, JPEG, GIF, TIFF are allowed.)";
      return false;
  
    }
    else if (gameExt.indexOf(GFile2[1]) == -1) {
          BErr.style.display = "block";
          BErr.innerHTML = "Game file format is invalid.";
          return false;
    }
    else {
    var TSize = document.forms.game_sub.game_thumb.form[0].size;
    if (TSize &gt; 1000000) {
      BErr.style.display = "block";
      BErr.innerHTML = "Thumbnail is too big. (Max size: 1MB)";
      return false;
    }
    else {
      BErr.style.display = "block";
      BErr.innerHTML = "Error";
      return false;
    }
    }
  }
  else {
      BErr.style.display = "block";
      BErr.innerHTML = "Your browser is outdated and cannot support file upload. Please update to latest version.";
      return false;
  
  }
  }
  </code></pre>
  
  <p>I tested it on my localhost server and on jsbin.com and it worked. But oddly, as time passed, it somehow just stops working. And this has happened twice. I worked on it last night, then opened it up this morning, same thing happened. I fixed it. Then this afternoon, looked at it again and same thing...</p>