fix projects
This commit is contained in:
9
assets/static/js/project-upload.js
Normal file
9
assets/static/js/project-upload.js
Normal file
@@ -0,0 +1,9 @@
|
||||
document
|
||||
.getElementById('project-upload')
|
||||
.addEventListener('submit', function (event) {
|
||||
const fileInput = document.getElementById('files');
|
||||
|
||||
if (fileInput.files.length === 0) {
|
||||
fileInput.removeAttribute('name');
|
||||
}
|
||||
});
|
@@ -37,4 +37,5 @@
|
||||
|
||||
<button type="submit" class="p-2 text-gray-900 bg-yellow-500 rounded-sm shadow hover:bg-yellow-600">Submit</button>
|
||||
</form>
|
||||
<script src="/static/js/project-upload.js" defer></script>
|
||||
{% endblock content%}
|
Reference in New Issue
Block a user