blob: a7f76bf8b4056715c39cd0411da15c09c93c9329 [file] [log] [blame]
Scott Baker9f6b8ed2014-11-17 23:44:03 -08001function uploadTextarea(event,textarea_id) {
2 var input = event.target;
3
4 var reader = new FileReader();
5 //reader.onloadstart = function() {
6 // reader.abort();
7 //};
8
9 reader.onloadend = function() {
10 if (reader.error) {
11 alert(reader.error.message);
12 } else {
13 $("#" + textarea_id).val(this.result);
14 //console.log(this.result);
15 }
16 };
17
18 reader.readAsText(input.files[0]);
19};