django-s3file | A lightweight file upload input for Django and Amazon S3 | AWS library
kandi X-RAY | django-s3file Summary
kandi X-RAY | django-s3file Summary
A lightweight file upload input for Django and Amazon S3
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Location
- Get AWS location
django-s3file Key Features
django-s3file Examples and Code Snippets
Community Discussions
Trending Discussions on django-s3file
QUESTION
Ok I have a strange edge-case, let me try to describe it:
I have a form with multiple submit buttons with different values. The submit value is important in my backend. I want to intercept a form submit (using onsubmit
) do an asynchronous task and continue the event.
Sadly calling Form.prototype.submit()
does not work, because the information which button was clicked is lost. Of course I can emulate that data, but just adding a hidden input, but I don't know how to figure out which button was clicked in the onsubmit
event.
If you need an example this is where I am trying to solve it: https://github.com/codingjoe/django-s3file/blob/master/s3file/static/s3file/js/s3file.js
...ANSWER
Answered 2017-Nov-10 at 21:16When you dynamically submit the form, you can do it differently than calling form.submit
. You can just trigger the click
event of whichever submit button you need to. Then, in a click
event handler for the submit buttons, you can assign a value to your hidden form field with the appropriate data.
Also, know that if you just give your submit buttons a name
attribute with a unique value and they will deliver their value
as part of the form's data that gets submitted.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install django-s3file
You can use django-s3file like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page