title: SCRIPT5007: Unable to get value of the property '0': object is null or undefined
body: <p>I am uploading a picture in a portlet and have checked the size of the image - if greater than 5MB it is supposed to show an alert but in IE (precisely IE9) it does not show an alert insted throw me an error - </p>
  
  <blockquote>
    <p>SCRIPT5007: Unable to get value of the property '0': object is null or
    undefined</p>
  </blockquote>
  
  <p>Code</p>
  
  <pre><code>&lt;script type="text/javascript" &gt;
  
  function _ImageUploadService_WAR_ImageUploadServiceportlet_initEditor() {
  //if you dont wnat the default text you can remove.
  
  return '';
  }
  
  function submitForm() {
  
  if( $("#_ImageUploadService_WAR_ImageUploadServiceportlet_Picture").val() == ""){
      alert("Please check, You have not Filled Required Field!!");
  }else{
          var result = confirm("Are you Sure?");
  
          if (result == true) {
                  document._ImageUploadService_WAR_ImageUploadServiceportlet_photoGallery.submit();
          } else {
              return false;
          }
  }
  }
  
  function checkSize(e){
  var val = document.getElementById(e);
  var sizeInMB = (val.files[0].size / (1024*1024)).toFixed(2);
  if(sizeInMB &gt; 5){
      alert("Attachment Size Exceeds The Allowable Limit!!");
      $("#"+e).val("");
  }
  }
  
  &lt;/script&gt;
  </code></pre>