Created
September 15, 2011 20:22
-
-
Save pawellenart/1220366 to your computer and use it in GitHub Desktop.
This file contains 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 createUploader(){ | |
var uploader = new qq.FileUploader({ | |
element: document.getElementById('file-uploader'), | |
action: '../include/upload/upload.php', | |
debug: false, | |
onSubmit: function() { | |
$("#su_name, #su_company, #su_project, #su_email").css('border', '0'); | |
if ($("#su_name").val() == "" || | |
$("#su_company").val() == "" || | |
$("#su_project").val() == "" || | |
$("#su_email").val() == "") { | |
$("#su_name, #su_company, #su_project, #su_email").each(function() { | |
if ($(this).val() == "") { | |
$(this).css('border', '1px solid red'); | |
} | |
}); | |
alert("You have to fill out all of the details before uploading files."); | |
return false; | |
} | |
else { | |
setParams({ | |
name: $('#su_name').val(), | |
company: $('#su_company').val(), | |
project: $('#su_project').val(), | |
email: $("su_email").val() | |
}); | |
return true; | |
} | |
}, | |
onComplete: function() { | |
$("#su_name, #su_company, #su_project, #su_email").css('border', '0').val(''); | |
$('ul.qq-upload-list').fadeOut('slow', function() { | |
$(this).html('').show(); // poof! a magic trick! | |
}); | |
} | |
}); | |
} | |
window.onload = createUploader; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment