Created
July 25, 2011 14:22
-
-
Save andreaseger/1104225 to your computer and use it in GitHub Desktop.
handling file inputs via javascript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function clearFileInput( id ) | |
{ | |
var elem = document.getElementById( id ); | |
elem.parentNode.innerHTML = elem.parentNode.innerHTML; | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getUploadSize(){ | |
var elem = document.getElementById("moreUploads"); | |
var size=0; | |
for(i=0;i<elem.childElementCount;i++){ | |
if(elem.children[i].children[0].files[0] != null) | |
size += elem.children[i].children[0].files[0].size; | |
} | |
return size; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment