-
-
Save psbolden/3f56d1547a21d8ae8aa33a0811fd5cf1 to your computer and use it in GitHub Desktop.
// source http://jsbin.com/lekuc/4
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
// use jQuery shipped with Uploadcare | |
$ = uploadcare.jQuery; | |
var widget = uploadcare.MultipleWidget('input'); | |
// disable submit button | |
$('#submit').attr('disabled', true); | |
widget.onUploadComplete(function(info) { | |
// upload is complete | |
console.log(info); | |
console.log('onUploadComplete'); | |
// enable submit button | |
$('#submit').attr('disabled', false); | |
// trigger click event | |
$('#submit').trigger('click'); | |
}) |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
<script> | |
UPLOADCARE_PUBLIC_KEY = 'demopublickey'; | |
</script> | |
<script charset="utf-8" src="https://ucarecdn.com/widget/1.4.0/uploadcare/uploadcare-1.4.0.min.js"></script> | |
</head> | |
<body> | |
<form> | |
<input type="hidden" role="uploadcare-uploader" data-multiple="true" /> | |
<input type="submit" id="submit"> | |
</form> | |
<script id="jsbin-javascript"> | |
// use jQuery shipped with Uploadcare | |
$ = uploadcare.jQuery; | |
var widget = uploadcare.MultipleWidget('input'); | |
// disable submit button | |
$('#submit').attr('disabled', true); | |
widget.onUploadComplete(function(info) { | |
// upload is complete | |
console.log(info); | |
console.log('onUploadComplete'); | |
// enable submit button | |
$('#submit').attr('disabled', false); | |
// trigger click event | |
$('#submit').trigger('click'); | |
}) | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment