Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<!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>
// 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');
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.