Comments (6)
I have no free time to help for you now. But I think that you go right way, problem is in onclick event.
from yii2-attachments.
I ended up with something like this in the form:
<?php
$this->registerJs("
var formbutton = $('#formsubmit');
formbutton.on('click', function(e) {
$('#formsubmit').prop('disabled', true);
e.preventDefault();
$('#file-input').fileinput('upload');
});
$('#file-input').on('filebatchuploadcomplete', function(event, files, extra) {
document.mioform.submit();
});
");
Being formbutton
the ID of the submit button, and mioform
the name of the form.
It still needs some enhancements, upload and validation errors are not handled
from yii2-attachments.
Fixed just now, please update and check how does it work
from yii2-attachments.
working great, thanks!
a little improvement: disable the submit button while uploading, and reenable in case of errors
from yii2-attachments.
Error check is not perfect... For example if the uploaded files are bigger than max_post_size or max_upload_size an error is displayed in the widget, but the form is submitted anyway
from yii2-attachments.
Fixed on f45842c, please test it
from yii2-attachments.
Related Issues (20)
- Thumbnail style view HOT 3
- How to add dynamic location
- when uploaded file has no extension upload failes (type cannot be empty in model)
- array_slice() expects parameter 1 to be array, object given HOT 4
- Problem when using AR in console HOT 1
- AttachmentsInput and AttachmentsTable do not display
- Configuration of migration HOT 1
- Failed to hide initialPreview
- Event afterUpload
- Yii2 attachment module not found
- How to get the url to the already uploaded image HOT 1
- How to copy (duplicate) attachments from one model to another?
- Possibility of attaching files to the model with possible errors
- Open file instead of download HOT 1
- Replace saving short model name with full
- Problem with drag & drop with new version of fileinput
- Calling multiple saves of the model on same request raises Exception
- 404 page not found .....?r=attachments%2Ffile%2Fupload
- Latest version requires php 8.0 functionality
- Lastest Version Need Bootstrap5 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yii2-attachments.