- July 15, 2009
- admin jquery imagefield filefield
- 2 (after 2 ratings)
The widget for FileField and ImageField has a problem: it doesn't supports clear its value and it doesn't delete the old file when you replace it for a new one.
This is a solution for this. It is just for Admin, but you can make changes to be compatible with common forms.
The jQuery code will put an <input type="checkbox"> tag next to every <input type="file"> and user can check it to clear the field value.
When a user just replace the current file for a new one, the old file will be deleted.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
More like this
- Removing old ImageFields and FileFields when updating through admin by alejandro.alonso 4 years, 3 months ago
- load m2m fields objects by dirol 6 years, 2 months ago
- Temporary admin messages (MOTD) by bthomas 7 years, 6 months ago
- REMOVE IMAGEFIELD ATTACHMENT IN DJANGO by timonweb 4 years, 3 months ago
- Updated FileField / ImageField with a delete checkbox by tomZ 8 years, 5 months ago